bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --version for CVS Bison


From: Joel E. Denny
Subject: Re: --version for CVS Bison
Date: Sun, 28 May 2006 04:56:32 -0400 (EDT)

On Sat, 20 May 2006, Joel E. Denny wrote:

> Before we begin committing again, I wonder if we might settle the 
> --version issue that Paul (I believe) raised not too long ago.  
> Specifically, which of the following should --version for CVS Bison print?
> 
> 1. "2.2a"  This is not true.  There is no 2.2a yet.
> 
> 2. "2.2a-cvs"  Are we sure the next release won't be 2.3 or 3.0?  Well, 
> maybe we are this time, but do we know in general?
> 
> 3. "2.2-cvs"  Why does our choice of CVS as the version control system 
> matter?

Another reason I don't like #3 is that it seems to conflict with the 
coreutils practice, which I believe is #2.

> 4. "2.2-devel"  I read this as further development with 2.2 as the base.

I now worry that #4 is misleading as some projects use the "-devel" suffix 
to indicate a supplementary package for developers.

> Akim also mentioned the idea of using the ChangeLog revision.  This would 
> add further precision, but how do you suggest we implement that?

How about the following patch?  If there are no objections, I'll install 
it in a few days.

Joel

Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1487
diff -p -u -r1.1487 ChangeLog
--- ChangeLog   27 May 2006 00:28:17 -0000      1.1487
+++ ChangeLog   28 May 2006 08:53:47 -0000
@@ -1,3 +1,19 @@
+$Id$
+
+2006-05-28  Joel E. Denny  <address@hidden>
+
+       Between Bison releases, append `+' to the previous Bison version
+       number, and print the ChangeLog's CVS Id keyword from --version.
+       * ChangeLog: Add Id header.
+       * configure.ac (AC_INIT): Rename version from `2.2a' to `2.2+'.
+       * src/.cvsignore: Add changelog_id.h.
+       * src/Makefile.am (bison_SOURCES): Add changelog_id.h.
+       (BUILT_SOURCES): Likewise.
+       (changelog_id.h): New target rule.  This file #define's CHANGELOG_ID to
+       either the Id from ChangeLog or to the empty string if VERSION doesn't
+       contain `+'.
+       * src/getargs.c (version): Print CHANGELOG_ID.
+
 2006-05-26  Paul Eggert  <address@hidden>
 
        * data/yacc.c (yy_reduce_print): Omit trailing white space in
Index: configure.ac
===================================================================
RCS file: /sources/bison/bison/configure.ac,v
retrieving revision 1.66
diff -p -u -r1.66 configure.ac
--- configure.ac        19 May 2006 23:19:04 -0000      1.66
+++ configure.ac        28 May 2006 08:53:47 -0000
@@ -24,7 +24,7 @@
 # least Autoconf 2.59.
 AC_PREREQ(2.59)
 
-AC_INIT([GNU Bison], [2.2a], address@hidden)
+AC_INIT([GNU Bison], [2.2+], address@hidden)
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 
Index: src/.cvsignore
===================================================================
RCS file: /sources/bison/bison/src/.cvsignore,v
retrieving revision 1.16
diff -p -u -r1.16 .cvsignore
--- src/.cvsignore      3 May 2004 07:36:12 -0000       1.16
+++ src/.cvsignore      28 May 2006 08:53:50 -0000
@@ -5,6 +5,7 @@
 Makefile
 Makefile.in
 bison
+changelog_id.h
 scan-gram.c
 scan-skel.c
 yacc
Index: src/Makefile.am
===================================================================
RCS file: /sources/bison/bison/src/Makefile.am,v
retrieving revision 1.67
diff -p -u -r1.67 Makefile.am
--- src/Makefile.am     9 Dec 2005 23:51:25 -0000       1.67
+++ src/Makefile.am     28 May 2006 08:53:50 -0000
@@ -34,6 +34,7 @@ EXTRA_SCRIPTS = yacc
 bison_SOURCES =                                          \
        LR0.c LR0.h                               \
        assoc.c assoc.h                           \
+       changelog_id.h                            \
        closure.c closure.h                       \
        complain.c complain.h                     \
        conflicts.c conflicts.h                   \
@@ -66,7 +67,7 @@ bison_SOURCES =                                         \
 
 EXTRA_bison_SOURCES = scan-skel.l scan-gram.l
 
-BUILT_SOURCES = scan-skel.c scan-gram.c parse-gram.c parse-gram.h
+BUILT_SOURCES = changelog_id.h scan-skel.c scan-gram.c parse-gram.c 
parse-gram.h
 
 MOSTLYCLEANFILES = yacc
 
@@ -78,6 +79,15 @@ yacc:
 echo:
        echo $(bison_SOURCES) $(noinst_HEADERS)
 
+changelog_id.h: $(top_srcdir)/configure $(top_srcdir)/ChangeLog
+       echo -n '#define CHANGELOG_ID "' > $@
+       if ( echo '@VERSION@' | grep + >/dev/null 2>&1 ); then \
+         grep '^$$Id' $(top_srcdir)/ChangeLog \
+           | sed 's/$$$$/$$\\n"/' >> $@; \
+       else \
+         echo '"' >> $@; \
+       fi
+
 # The following rule is not designed to be portable,
 # and relies on tools that not everyone has.
 
Index: src/getargs.c
===================================================================
RCS file: /sources/bison/bison/src/getargs.c,v
retrieving revision 1.68
diff -p -u -r1.68 getargs.c
--- src/getargs.c       14 May 2006 20:40:34 -0000      1.68
+++ src/getargs.c       28 May 2006 08:53:51 -0000
@@ -22,6 +22,7 @@
 
 #include <config.h>
 #include "system.h"
+#include "changelog_id.h"
 
 #include <argmatch.h>
 #include <error.h>
@@ -272,6 +273,7 @@ version (void)
      continue.  */
   printf (_("bison (GNU Bison) %s"), VERSION);
   putc ('\n', stdout);
+  printf ("%s", CHANGELOG_ID);
   fputs (_("Written by Robert Corbett and Richard Stallman.\n"), stdout);
   putc ('\n', stdout);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]