Commit 345422f6 authored by marko's avatar marko

branches/zip: scripts/dynconfig: Correct misleading usage message.

At present, the script only accepts one command line parameter.
Append newline to some die messages, so that the Perl interpreter
will not print the file name and line number of the failing statement.
parent 2c521319
...@@ -105,14 +105,14 @@ sub squeeze($) { ...@@ -105,14 +105,14 @@ sub squeeze($) {
return(rtrim(ltrim($string))); return(rtrim(ltrim($string)));
} }
if ($#ARGV < 0) { if ($#ARGV != 0) {
die "usage: $0 <path/to/mysqlbug> [options e.g. CC=gcc CXX=gcc]\n"; die "usage: $0 path/to/mysqlbug\n";
} }
open(F, $ARGV[0]) || open(F, $ARGV[0]) ||
die "Error opening $ARGV[0]: $!"; die "Error opening $ARGV[0]: $!\n";
read(F, $buffer, 131072) || read(F, $buffer, 131072) ||
die "Error reading file $ARGV[0]: $!"; die "Error reading file $ARGV[0]: $!\n";
close(F); close(F);
my @matched = grep(/^CONFIGURE_LINE=/, split(/\n/, $buffer)); my @matched = grep(/^CONFIGURE_LINE=/, split(/\n/, $buffer));
...@@ -122,7 +122,7 @@ if ($#matched == -1 ) { ...@@ -122,7 +122,7 @@ if ($#matched == -1 ) {
die "CONFIGURE_LINE= not found in : $ARGV[0]\n"; die "CONFIGURE_LINE= not found in : $ARGV[0]\n";
# Check if more than one line matched # Check if more than one line matched
} elsif ($#matched > 0) { } elsif ($#matched > 0) {
die "Error: $#matched matches found.\n"; die "Error: $#matched matches for CONFIGURE_LINE= found.\n";
} }
# Since CONFIGURE_LINE is an environment variable we extract the value, # Since CONFIGURE_LINE is an environment variable we extract the value,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment