From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24212 invoked from network); 9 Jan 2009 20:14:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Jan 2009 20:14:05 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 59116 invoked from network); 9 Jan 2009 20:13:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Jan 2009 20:13:58 -0000 Received: (qmail 10344 invoked by alias); 9 Jan 2009 20:13:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26272 Received: (qmail 10327 invoked from network); 9 Jan 2009 20:13:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 9 Jan 2009 20:13:53 -0000 Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by bifrost.dotsrc.org (Postfix) with ESMTP id E7F53802720C for ; Fri, 9 Jan 2009 21:13:38 +0100 (CET) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090109201338.WPF7670.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Fri, 9 Jan 2009 20:13:38 +0000 Received: from pws-pc ([81.107.45.176]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090109201336.NPRR22934.aamtaout04-winn.ispmail.ntl.com@pws-pc> for ; Fri, 9 Jan 2009 20:13:36 +0000 Date: Fri, 9 Jan 2009 20:13:33 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: Getting the CVS revision of Zsh Message-ID: <20090109201333.5dcc8fdb@pws-pc> In-Reply-To: <2d460de70901090507i7c3179e4u1e2def459f214566@mail.gmail.com> References: <2d460de70901090301h6b309a7cm19c5ebfec989ff2c@mail.gmail.com> <200901091121.n09BLVvZ006382@news01.csr.com> <2d460de70901090348t3ea9e25fi29a7165ee42ae5e5@mail.gmail.com> <200901091158.n09BwPii006839@news01.csr.com> <2d460de70901090441i7ef1795bs42ed98fe0f33c9ba@mail.gmail.com> <200901091258.n09CwS7T007471@news01.csr.com> <2d460de70901090507i7c3179e4u1e2def459f214566@mail.gmail.com> X-Mailer: Claws Mail 3.6.1 (GTK+ 2.14.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=2o9eVglb3IMA:10 a=NLZqzBF-AAAA:8 a=ZP_64Qur41919YVcfgsA:9 a=uxdaxGsJVa_xmDJMqYYA:7 a=bQV7SH46m9JdwHEn032U56Cs9v8A:4 a=LY0hPdMaydYA:10 a=ZfyWQJYG1gAA:10 a=a9kES2-tPZCXt322:21 a=f8lFWlUTtjKzeHk0:21 X-Virus-Scanned: ClamAV 0.92.1/8848/Fri Jan 9 14:16:38 2009 on bifrost X-Virus-Status: Clean On Fri, 9 Jan 2009 14:07:27 +0100 "Richard Hartmann" wrote: > On Fri, Jan 9, 2009 at 13:58, Peter Stephenson wrote: > > > Hmm... yes, grepping an $Id$ out of ChangeLog, which should always be > > present, ought to be good enough. It probably needs to be added at the > > end. That's considerably simpler. > > The docs[1] tell me there is a $Revision$ (Move to workers.) I've already committed a ChangeLog with the revision in. Using this appears to be straightforward... Index: Doc/Zsh/params.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/params.yo,v retrieving revision 1.49 diff -u -r1.49 params.yo --- Doc/Zsh/params.yo 5 Sep 2008 21:02:13 -0000 1.49 +++ Doc/Zsh/params.yo 9 Jan 2009 20:10:51 -0000 @@ -727,6 +727,14 @@ Expands to the basename of the command used to invoke this instance of zsh. ) +vindex(ZSH_PATCHLEVEL) +item(tt(ZSH_PATCHLEVEL))( +The revision string for the version number of the ChangeLog file +in the zsh distribution. This is most useful in order to keep +track of versions of the shell during development between releases; +hence most users should not use it and should instead rely on +tt($ZSH_VERSION). +) item(tt(zsh_scheduled_events))( See ifzman(the section `The zsh/sched Module' in zmanref(zshmodules))\ ifnzman(noderef(The zsh/sched Module)). @@ -740,7 +748,7 @@ ) vindex(ZSH_VERSION) item(tt(ZSH_VERSION))( -The version number of this zsh. +The version number of the release of zsh. ) enditem() texinode(Parameters Used By The Shell)()(Parameters Set By The Shell)(Parameters) Index: Src/params.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/params.c,v retrieving revision 1.151 diff -u -r1.151 params.c --- Src/params.c 8 Jan 2009 13:12:09 -0000 1.151 +++ Src/params.c 9 Jan 2009 20:10:55 -0000 @@ -31,6 +31,7 @@ #include "params.pro" #include "version.h" +#include "patchlevel.h" /* what level of localness we are at */ @@ -748,6 +749,7 @@ setsparam("VENDOR", ztrdup(VENDOR)); setsparam("ZSH_NAME", ztrdup(zsh_name)); setsparam("ZSH_VERSION", ztrdup(ZSH_VERSION)); + setsparam("ZSH_PATCHLEVEL", ztrdup(ZSH_PATCHLEVEL)); setaparam("signals", sigptr = zalloc((SIGCOUNT+4) * sizeof(char *))); for (t = sigs; (*sigptr++ = ztrdup(*t++)); ); Index: Src/zsh.mdd =================================================================== RCS file: /cvsroot/zsh/zsh/Src/zsh.mdd,v retrieving revision 1.18 diff -u -r1.18 zsh.mdd --- Src/zsh.mdd 19 Sep 2008 12:58:54 -0000 1.18 +++ Src/zsh.mdd 9 Jan 2009 20:10:55 -0000 @@ -33,12 +33,21 @@ init.o params.o parse.o: version.h +params.o: patchlevel.h + # The main shell doesn't currently need zshcurses.h and zshterm.h, # but make sure these are built with the headers. # If it did need need them they would be in headers at the top instead. version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h echo '#define ZSH_VERSION "'$(VERSION)'"' > $@ +patchlevel.h: $(sdir_top)/ChangeLog + { \ + echo -n "#define ZSH_PATCHLEVEL "; \ + sed -ne 's/^\* *\$$Revision: \(.*\) \$$/"\1"/p' \ + $(sdir_top)/ChangeLog; \ + } >patchlevel.h + zshcurses.h: ../config.h @if test x$(ZSH_CURSES_H) != x; then \ echo "#include <$(ZSH_CURSES_H)>" >zshcurses.h; \ -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/