snapshot generation broken again...

Started by Stefan Kaltenbrunnerabout 16 years ago8 messages
#1Stefan Kaltenbrunner
stefan@kaltenbrunner.cc

Looks like somebody broke the snapshot generation script again:

Note: meta manvol : see http://docbook.sf.net/el/manvolnum
dblink_build_sql_delete
Note: Writing man1/dblink_build_sql_delete.1
Note: meta manvol : no refentry/refmeta/manvolnum
dblink_build_sql_update
Note: meta manvol : see http://docbook.sf.net/el/manvolnum
dblink_build_sql_update
Note: Writing man1/dblink_build_sql_update.1
Usage: genbki.pl [options] header...

Options:
-I path to include files
-o output path
--set-version PostgreSQL version number for initdb cross-check

genbki.pl generates BKI files from specially formatted
header files. These BKI files are used to initialize the
postgres template database.

Report bugs to <pgsql-bugs@postgresql.org>.
gmake[4]: *** [postgres.bki] Error 255
gmake[3]: *** [distprep] Error 2
gmake[2]: *** [distprep] Error 2
gmake[1]: *** [distprep] Error 2
gmake: *** [distdir] Error 2

Stefan

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Kaltenbrunner (#1)
Re: snapshot generation broken again...

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

Looks like somebody broke the snapshot generation script again:

[ scratches head... ] "make dist" works for me. Can you get a
trace indicating what command was used to call genbki.pl?

regards, tom lane

#3Stefan Kaltenbrunner
stefan@kaltenbrunner.cc
In reply to: Tom Lane (#2)
Re: snapshot generation broken again...

Tom Lane wrote:

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

Looks like somebody broke the snapshot generation script again:

[ scratches head... ] "make dist" works for me. Can you get a
trace indicating what command was used to call genbki.pl?

heh that's a nice one the snapshot generation script uses "
gmake -s VERSION=snapshot dist" and that leads to getting "
--set-version=snapshot" passed to genbki.pl which fails the regex there
and the if() falls through to the usage().

Stefan

#4John Naylor
jcnaylor@gmail.com
In reply to: Stefan Kaltenbrunner (#3)
1 attachment(s)
Re: snapshot generation broken again...

Here's a fix. Sorry, I didn't realize it was ever called without a
version number.

On Wed, Jan 6, 2010 at 11:18 AM, Stefan Kaltenbrunner

Show quoted text

heh that's a nice one the snapshot generation script uses "
gmake -s VERSION=snapshot dist" and that leads to getting "
--set-version=snapshot" passed to genbki.pl which fails the regex there and
the if() falls through to the usage().

Attachments:

bki_versioning.patchtext/x-patch; charset=US-ASCII; name=bki_versioning.patchDownload
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index edd3aee..94c2d45 100644
*** a/src/backend/catalog/genbki.pl
--- b/src/backend/catalog/genbki.pl
*************** while (@ARGV)
*** 40,48 ****
      {
          push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
      }
!     elsif ($arg =~ /^--set-version=(\d+\.\d+).*$/)
      {
          $major_version = $1;
      }
      else
      {
--- 40,52 ----
      {
          push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
      }
!     elsif ($arg =~ /^--set-version=(.*)$/)
      {
          $major_version = $1;
+         # Extract version information, if any.
+         if ($major_version =~ /^(\d+.\d+)/) {
+             $major_version = $1;
+         }
      }
      else
      {
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Kaltenbrunner (#3)
Re: snapshot generation broken again...

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

Tom Lane wrote:

[ scratches head... ] "make dist" works for me. Can you get a
trace indicating what command was used to call genbki.pl?

heh that's a nice one the snapshot generation script uses "
gmake -s VERSION=snapshot dist" and that leads to getting "
--set-version=snapshot" passed to genbki.pl which fails the regex there
and the if() falls through to the usage().

Huh ... that doesn't make any sense, because the previous shell-script
version also spits up on non-numeric VERSION. How did it work before?

[... thinks ...] Oh: it didn't, because we didn't use to try to call
this during distprep. We'd not want "snapshot" as the version number
in postgres.bki anyway. So we need to change the makefile to not rely
on VERSION for this, I guess. Will fix.

regards, tom lane

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: John Naylor (#4)
Re: snapshot generation broken again...

John Naylor <jcnaylor@gmail.com> writes:

Here's a fix. Sorry, I didn't realize it was ever called without a
version number.

It's not supposed to be. If it fails to put the correct version number
into the .bki file, initdb will spit up. This is really a makefile bug,
not genbki's fault.

regards, tom lane

#7Stefan Kaltenbrunner
stefan@kaltenbrunner.cc
In reply to: Tom Lane (#6)
Re: snapshot generation broken again...

Tom Lane wrote:

John Naylor <jcnaylor@gmail.com> writes:

Here's a fix. Sorry, I didn't realize it was ever called without a
version number.

It's not supposed to be. If it fails to put the correct version number
into the .bki file, initdb will spit up. This is really a makefile bug,
not genbki's fault.

really? there are provisions withing genbki.pl that are supposed to
provide a proper error message(and would have likely helped to find the
issue in that case as well):

die "Version not specified or wrong format.\n" if !defined $major_version;

however due to the way the current checks are executed you won't
actually see that error...

Stefan

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Kaltenbrunner (#7)
Re: snapshot generation broken again...

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:

really? there are provisions withing genbki.pl that are supposed to
provide a proper error message(and would have likely helped to find the
issue in that case as well):
die "Version not specified or wrong format.\n" if !defined $major_version;
however due to the way the current checks are executed you won't
actually see that error...

Good point, the way that the error checking is done in the script leaves
a lot to be desired there.

regards, tom lane