Skip to content

Commit 87ac6e7

Browse files
committed
Make error messages for bad --set-version argument more useful.
Per Stefan.
1 parent d7085f2 commit 87ac6e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/catalog/genbki.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
1111
# Portions Copyright (c) 1994, Regents of the University of California
1212
#
13-
# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.5 2010/01/06 19:56:29 tgl Exp $
13+
# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.6 2010/01/06 22:02:45 tgl Exp $
1414
#
1515
#----------------------------------------------------------------------
1616

@@ -40,9 +40,11 @@
4040
{
4141
push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
4242
}
43-
elsif ($arg =~ /^--set-version=(\d+\.\d+)$/)
43+
elsif ($arg =~ /^--set-version=(.*)$/)
4444
{
4545
$major_version = $1;
46+
die "Version must be in format nn.nn.\n"
47+
if !($major_version =~ /^\d+\.\d+$/);
4648
}
4749
else
4850
{
@@ -53,7 +55,7 @@
5355
# Sanity check arguments.
5456
die "No input files.\n" if !@input_files;
5557
die "No include path; you must specify -I at least once.\n" if !@include_path;
56-
die "Version not specified or wrong format.\n" if !defined $major_version;
58+
die "--set-version must be specified.\n" if !defined $major_version;
5759

5860
# Make sure output_path ends in a slash.
5961
if ($output_path ne '' && substr($output_path, -1) ne '/')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy