From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38785 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Module for svn info Date: Wed, 23 Jan 2008 08:34:04 -0400 (AST) Message-ID: References: <4D2077CD-619C-4429-A1D7-733931A9FB5C@csiro.au> <4795D03D.9090109@scmb.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201095669 3102 80.91.229.10 (23 Jan 2008 13:41:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jan 2008 13:41:09 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 23 14:52:02 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by dough.gmane.org with esmtp (Exim 4.50) id 1JHg1I-0002eO-GS for gctc-ntg-context-518@m.gmane.org; Wed, 23 Jan 2008 14:52:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1549F1FC6F; Wed, 23 Jan 2008 14:35:48 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11852-02; Wed, 23 Jan 2008 14:35:02 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 937521FBF9; Wed, 23 Jan 2008 14:34:57 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9B2B41FBEB for ; Wed, 23 Jan 2008 14:34:47 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10708-04-3 for ; Wed, 23 Jan 2008 14:34:09 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with ESMTP id 462951FB8C for ; Wed, 23 Jan 2008 14:34:05 +0100 (CET) Original-Received: FROM adi-laptop.local (c-68-40-40-75.hsd1.mi.comcast.net [68.40.40.75]) BY hackers.mr.itd.umich.edu ID 4797424B.3BF29.18704 ; 23 Jan 2008 08:34:03 -0500 X-X-Sender: adityam@adi-laptop In-Reply-To: <4795D03D.9090109@scmb.de> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38785 Archived-At: On Tue, 22 Jan 2008, Markus Bernhardt wrote: > \def\SVNVERSION{svnversion -n > svnversion.tex} > > \ifeof18 > \installprogram{\SVNVERSION}% > \else > \executesystemcommand{\SVNVERSION}% > \fi Looks ok to me. Coming back to calculating the maximum of versions, this is possible to do inside TeX. Here is a short proof of concept. We need a two pass mechanism since revisions could be defined after they need to be used. \unprotect \def\REVISION#1 {\doifdefinedelse{!!REVISION} {\ifdim#1pt > \dimexpr1pt*\!!REVISION \edef\!!REVISION{#1} \fi} {\edef\!!REVISION{#1}}} \definetwopasslist{REVISION} % Execute this in the beginning of document \def\initializeREVISION {\gettwopassdata{REVISION} \iftwopassdatafound \xdef\getREVISION{\twopassdata} \else \def\getREVISION{Not Found} \fi \global\let\initializeREVISION\relax} % Execute this at the end of document \def\saveREVISION {\savetwopassdata {REVISION} {\getREVISION} {\!!REVISION}} \appendtoks \initializeREVISION \to \everystarttext \appendtoks \saveREVISION \to \everystoptext \protect \starttext File 1:\REVISION{10} \getREVISION File 2:\REVISION{4} \getREVISION File 3:\REVISION{14} \getREVISION \stoptext Now this just needs to be plugged into the command to get revision information from svn tags. Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________