diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-15 13:49:49 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-08-15 13:49:49 -0400 |
commit | ca9112a424ff68ec4f2ef67b47122f7d61412964 (patch) | |
tree | da13d4eead313a32e53849ea0b7dd1de9a00fb29 /src | |
parent | b5bce6c1ec6061c8a4f730d927e162db7e2ce365 (diff) | |
download | postgresql-ca9112a424ff68ec4f2ef67b47122f7d61412964.tar.gz postgresql-ca9112a424ff68ec4f2ef67b47122f7d61412964.zip |
Stamp HEAD as 10devel.
This is a good bit more complicated than the average new-version stamping
commit, because it includes various adjustments in pursuit of changing
from three-part to two-part version numbers. It's likely some further
work will be needed around that change; but this is enough to get through
the regression tests, at least in Unix builds.
Peter Eisentraut and Tom Lane
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/genbki.pl | 4 | ||||
-rw-r--r-- | src/backend/utils/init/miscinit.c | 26 | ||||
-rw-r--r-- | src/bin/pg_upgrade/check.c | 6 | ||||
-rw-r--r-- | src/bin/pg_upgrade/server.c | 2 | ||||
-rw-r--r-- | src/include/pg_config.h.win32 | 8 | ||||
-rw-r--r-- | src/interfaces/libpq/libpq.rc.in | 8 | ||||
-rw-r--r-- | src/port/win32ver.rc | 4 | ||||
-rw-r--r-- | src/tools/msvc/Solution.pm | 6 | ||||
-rwxr-xr-x | src/tools/version_stamp.pl | 14 |
9 files changed, 38 insertions, 40 deletions
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 54a14e5dc36..26d165203dc 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -43,8 +43,8 @@ while (@ARGV) elsif ($arg =~ /^--set-version=(.*)$/) { $major_version = $1; - die "Version must be in format nn.nn.\n" - if !($major_version =~ /^\d+\.\d+$/); + die "Invalid version string.\n" + if !($major_version =~ /^\d+$/); } else { diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index d4625a6238f..22b046e006e 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -1334,16 +1334,13 @@ ValidatePgVersion(const char *path) char full_path[MAXPGPATH]; FILE *file; int ret; - long file_major, - file_minor; - long my_major = 0, - my_minor = 0; + long file_major; + long my_major; char *endptr; - const char *version_string = PG_VERSION; + char file_version_string[64]; + const char *my_version_string = PG_VERSION; - my_major = strtol(version_string, &endptr, 10); - if (*endptr == '.') - my_minor = strtol(endptr + 1, NULL, 10); + my_major = strtol(my_version_string, &endptr, 10); snprintf(full_path, sizeof(full_path), "%s/PG_VERSION", path); @@ -1362,8 +1359,11 @@ ValidatePgVersion(const char *path) errmsg("could not open file \"%s\": %m", full_path))); } - ret = fscanf(file, "%ld.%ld", &file_major, &file_minor); - if (ret != 2) + file_version_string[0] = '\0'; + ret = fscanf(file, "%63s", file_version_string); + file_major = strtol(file_version_string, &endptr, 10); + + if (ret != 1 || endptr == file_version_string) ereport(FATAL, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("\"%s\" is not a valid data directory", @@ -1374,13 +1374,13 @@ ValidatePgVersion(const char *path) FreeFile(file); - if (my_major != file_major || my_minor != file_minor) + if (my_major != file_major) ereport(FATAL, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("database files are incompatible with server"), - errdetail("The data directory was initialized by PostgreSQL version %ld.%ld, " + errdetail("The data directory was initialized by PostgreSQL version %s, " "which is not compatible with this version %s.", - file_major, file_minor, version_string))); + file_version_string, my_version_string))); } /*------------------------------------------------------------------------- diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index f901e3c5125..ed41dee6a54 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -1082,8 +1082,8 @@ get_bin_version(ClusterInfo *cluster) char cmd[MAXPGPATH], cmd_output[MAX_STRING]; FILE *output; - int pre_dot, - post_dot; + int pre_dot = 0, + post_dot = 0; snprintf(cmd, sizeof(cmd), "\"%s/pg_ctl\" --version", cluster->bindir); @@ -1098,7 +1098,7 @@ get_bin_version(ClusterInfo *cluster) if (strchr(cmd_output, '\n') != NULL) *strchr(cmd_output, '\n') = '\0'; - if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) != 2) + if (sscanf(cmd_output, "%*s %*s %d.%d", &pre_dot, &post_dot) < 1) pg_fatal("could not get version from %s\n", cmd); cluster->bin_version = (pre_dot * 100 + post_dot) * 100; diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c index 830335f5019..12432bb1d07 100644 --- a/src/bin/pg_upgrade/server.c +++ b/src/bin/pg_upgrade/server.c @@ -166,7 +166,7 @@ get_major_server_version(ClusterInfo *cluster) if (fscanf(version_fd, "%63s", cluster->major_version_str) == 0 || sscanf(cluster->major_version_str, "%d.%d", &integer_version, - &fractional_version) != 2) + &fractional_version) < 1) pg_fatal("could not get version from %s\n", cluster->pgdata); fclose(version_fd); diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32 index b6b88fcf0d2..8892c3cb4fa 100644 --- a/src/include/pg_config.h.win32 +++ b/src/include/pg_config.h.win32 @@ -554,10 +554,10 @@ #define PACKAGE_NAME "PostgreSQL" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "PostgreSQL 9.6beta4" +#define PACKAGE_STRING "PostgreSQL 10devel" /* Define to the version of this package. */ -#define PACKAGE_VERSION "9.6beta4" +#define PACKAGE_VERSION "10devel" /* Define to the name of a signed 128-bit integer type. */ #undef PG_INT128_TYPE @@ -566,10 +566,10 @@ #define PG_INT64_TYPE long long int /* PostgreSQL version as a string */ -#define PG_VERSION "9.6beta4" +#define PG_VERSION "10devel" /* PostgreSQL version as a number */ -#define PG_VERSION_NUM 90600 +#define PG_VERSION_NUM 100000 /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "postgresql" diff --git a/src/interfaces/libpq/libpq.rc.in b/src/interfaces/libpq/libpq.rc.in index e41a1a27f45..0d6f7049f55 100644 --- a/src/interfaces/libpq/libpq.rc.in +++ b/src/interfaces/libpq/libpq.rc.in @@ -1,8 +1,8 @@ #include <winver.h> VS_VERSION_INFO VERSIONINFO - FILEVERSION 9,6,0,0 - PRODUCTVERSION 9,6,0,0 + FILEVERSION 10,0,0,0 + PRODUCTVERSION 10,0,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0 FILEOS VOS__WINDOWS32 @@ -15,13 +15,13 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "PostgreSQL Access Library\0" - VALUE "FileVersion", "9.6.0\0" + VALUE "FileVersion", "10.0\0" VALUE "InternalName", "libpq\0" VALUE "LegalCopyright", "Copyright (C) 2016\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "libpq.dll\0" VALUE "ProductName", "PostgreSQL\0" - VALUE "ProductVersion", "9.6.0\0" + VALUE "ProductVersion", "10.0\0" END END BLOCK "VarFileInfo" diff --git a/src/port/win32ver.rc b/src/port/win32ver.rc index c21b74c0178..3ce092382bf 100644 --- a/src/port/win32ver.rc +++ b/src/port/win32ver.rc @@ -2,8 +2,8 @@ #include "pg_config.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION 9,6,0,0 - PRODUCTVERSION 9,6,0,0 + FILEVERSION 10,0,0,0 + PRODUCTVERSION 10,0,0,0 FILEFLAGSMASK 0x17L FILEFLAGS 0x0L FILEOS VOS_NT_WINDOWS32 diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index f07029bce16..9cb1ad36cf3 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -131,12 +131,12 @@ sub GenerateFiles if (/^AC_INIT\(\[PostgreSQL\], \[([^\]]+)\]/) { $self->{strver} = $1; - if ($self->{strver} !~ /^(\d+)\.(\d+)(?:\.(\d+))?/) + if ($self->{strver} !~ /^(\d+)(?:\.(\d+))?/) { confess "Bad format of version: $self->{strver}\n"; } - $self->{numver} = sprintf("%d%02d%02d", $1, $2, $3 ? $3 : 0); - $self->{majorver} = sprintf("%d.%d", $1, $2); + $self->{numver} = sprintf("%d%04d", $1, $2 ? $2 : 0); + $self->{majorver} = sprintf("%d", $1); } } close(C); diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl index cc685453dd6..3edd7bedaf5 100755 --- a/src/tools/version_stamp.pl +++ b/src/tools/version_stamp.pl @@ -22,8 +22,7 @@ # Major version is hard-wired into the script. We update it when we branch # a new development version. -$major1 = 9; -$major2 = 6; +$majorversion = 10; # Validate argument and compute derived variables $minor = shift; @@ -60,7 +59,6 @@ else } # Create various required forms of the version number -$majorversion = $major1 . "." . $major2; if ($dotneeded) { $fullversion = $majorversion . "." . $minor; @@ -70,7 +68,7 @@ else $fullversion = $majorversion . $minor; } $numericversion = $majorversion . "." . $numericminor; -$padnumericversion = sprintf("%d%02d%02d", $major1, $major2, $numericminor); +$padnumericversion = sprintf("%d%04d", $majorversion, $numericminor); # Get the autoconf version number for eventual nag message # (this also ensures we're in the right directory) @@ -110,15 +108,15 @@ sed_file("src/include/pg_config.h.win32", ); sed_file("src/interfaces/libpq/libpq.rc.in", -"-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/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " + . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$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/FILEVERSION [0-9]*,[0-9]*,[0-9]*,0/FILEVERSION $majorversion,0,$numericminor,0/' " + . "-e 's/PRODUCTVERSION [0-9]*,[0-9]*,[0-9]*,0/PRODUCTVERSION $majorversion,0,$numericminor,0/'" ); print "Stamped these files with version number $fullversion:\n$fixedfiles"; |