From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58437 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: requesting multipass Date: Tue, 27 Apr 2010 23:47:03 +0200 Message-ID: <4BD75B57.6000907@wxs.nl> References: <20100427150440.GA19428@aides> <4BD726B3.4090501@wxs.nl> <20100427210957.GA3705@aides> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1272404899 19581 80.91.229.12 (27 Apr 2010 21:48:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Apr 2010 21:48:19 +0000 (UTC) Cc: Philipp Gesang To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 27 23:48:15 2010 connect(): No such file or directory Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O6sdb-0001w2-DL for gctc-ntg-context-518@m.gmane.org; Tue, 27 Apr 2010 23:48:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4C4FFC9BC9; Tue, 27 Apr 2010 23:48:14 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 42v-fNJnm+Ov; Tue, 27 Apr 2010 23:48:10 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 59F80C9BB5; Tue, 27 Apr 2010 23:48:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 80FD9C9BB5 for ; Tue, 27 Apr 2010 23:48:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KZ6VjBsiKdY4 for ; Tue, 27 Apr 2010 23:48:03 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (sc-162.r-213-125-29.schoolconnect.nu [213.125.29.162]) by balder.ntg.nl (Postfix) with ESMTP id 339F8C9B8C for ; Tue, 27 Apr 2010 23:48:02 +0200 (CEST) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.191; Original-Received: from [10.100.1.191] (unverified [10.100.1.191]) by controller-9 (SurgeMail 4.3e) with ESMTP id 1697-1713362 for multiple; Tue, 27 Apr 2010 23:47:37 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 In-Reply-To: <20100427210957.GA3705@aides> X-Authenticated-User: hagen@controller-9 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:58437 Archived-At: On 27-4-2010 11:09, Philipp Gesang wrote: > On 2010-04-27<20:02:27>, Hans Hagen wrote: >> On 27-4-2010 5:04, Philipp Gesang wrote: >>> Hi all, >>> >>> >>> how do I trigger another pass? >>> >>> Using md5 and io I want to save data to a helper file and reuse it in a >>> second pass (like e.g. mtx-context.lua) or update the file if >>> appropriate. But I couldn't quite figure out how to request another pass >> >from the lua end. >> >> there's >> >> jobfiles.run( >> "filename-to-be-checked", >> "command-to-be-executed-if-changed" >> ) > > Good evening, Hans! > > > Let me clarify my intention a bit: jobfiles.run calls "context" on the > argument list, but that is not what I need. > > My problem is that I generate stuff during the tex run and want to > collect it in a table that is saved to a file at the end of the run. > This data is hashed at the beginning of the document and if the hash > does not match the end-run hash _or_ the file doesn't exist in the first > place, then I'd like to run another independent pass. > > (I guess I could use jobfiles.run to process \jobname at the very end of > the document but would have to handle recursion somehow.) so, as you save your data in a file, just after saving the table, hash that file: \starttext test \startluacode jobvariables.tobesaved.MyPersonalChecksum = file.checksum("MyName") or "no checksum" \stopluacode \stoptext the context runner will take care of extra runs then. (I'll think about a more robust user space for such status variables but as long as you use UpperCased names you quite safe.) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________