Create a script to handle stamping release version numbers into files,
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 10 Jun 2008 18:09:26 +0000 (18:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 10 Jun 2008 18:09:26 +0000 (18:09 +0000)
replacing the tedious and error-prone manual process we've been using.

src/tools/RELEASE_CHANGES
src/tools/version_stamp.pl

index 23af8e0e863ac25e736aac5f38516ce9d6ad5caf..5d8c67712a3a7349cea98e35d54cc2c28fe16c22 100644 (file)
@@ -1,9 +1,5 @@
 * Version numbers
-    configure.in and configure
-    bump interface version numbers
-      o src/interfaces/*/Makefile
-      o src/interfaces/libpq/libpq.rc (update for minor release)
-      o src/include/pg_config.h.win32 (update for minor release)
+    run src/tools/version_stamp.pl, then run autoconf (by packager)
 
 * Release notes
     update doc/src/sgml/release.sgml
index f42d970ac5776876cd4193d7ed247d1e8b942679..cb36fea52452ee6b35b1b8795ce522e3b68bf546 100755 (executable)
@@ -22,7 +22,7 @@
 
 # Major version is hard-wired into the script.  We update it when we branch
 # a new development version.
-$major1 = 8;
+$major1 = 7;
 $major2 = 4;
 
 # Validate argument and compute derived variables
@@ -52,8 +52,6 @@ if ($dotneeded) {
 } else {
     $fullversion = $majorversion . $minor;
 }
-$numericversion = $majorversion . "." . $numericminor;
-$padnumericversion = sprintf("%d%02d%02d", $major1, $major2, $numericminor);
 
 # Get the autoconf version number for eventual nag message
 # (this also ensures we're in the right directory)
@@ -80,20 +78,14 @@ sed_file("doc/bug.template",
         "-e 's/PostgreSQL version (example: PostgreSQL .*) *:  PostgreSQL .*/PostgreSQL version (example: PostgreSQL $fullversion):  PostgreSQL $fullversion/'");
 
 sed_file("src/include/pg_config.h.win32",
-       "-e 's/#define PACKAGE_STRING \"PostgreSQL .*\"/#define PACKAGE_STRING \"PostgreSQL $fullversion\"/' " .
-       "-e 's/#define PACKAGE_VERSION \".*\"/#define PACKAGE_VERSION \"$fullversion\"/' " .
         "-e 's/#define PG_VERSION \".*\"/#define PG_VERSION \"$fullversion\"/' " .
-        "-e 's/#define PG_VERSION_NUM .*/#define PG_VERSION_NUM $padnumericversion/'");
+        "-e 's/#define PG_VERSION_STR \".* (win32)\"/#define PG_VERSION_STR \"$fullversion (win32)\"/'");
 
-sed_file("src/interfaces/libpq/libpq.rc.in",
+sed_file("src/interfaces/libpq/libpq.rc",
         "-e 's/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $major1,$major2,$numericminor,0/' " .
         "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $major1,$major2,$numericminor,0/' " .
-        "-e 's/VALUE \"FileVersion\", \"[0-9.]*/VALUE \"FileVersion\", \"$numericversion/' " .
-        "-e 's/VALUE \"ProductVersion\", \"[0-9.]*/VALUE \"ProductVersion\", \"$numericversion/'");
-
-sed_file("src/port/win32ver.rc",
-        "-e 's/FILEVERSION    [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION    $major1,$major2,$numericminor,0/' " .
-        "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $major1,$major2,$numericminor,0/'");
+        "-e 's/VALUE \"FileVersion\", \"[0-9]*, [0-9]*, [0-9]*/VALUE \"FileVersion\", \"$major1, $major2, $numericminor/' " .
+        "-e 's/VALUE \"ProductVersion\", \"[0-9]*, [0-9]*, [0-9]*/VALUE \"ProductVersion\", \"$major1, $major2, $numericminor/'");
 
 print "Stamped these files with version number $fullversion:\n$fixedfiles";
 print "Don't forget to run autoconf $aconfver before committing.\n";