(minor) single quotes around variables in error messages

(plus a couple of other minor fixups)
This commit is contained in:
Sitaram Chamarty 2012-05-21 15:22:19 +05:30
parent 20d2120ea5
commit d04e79d291
15 changed files with 33 additions and 33 deletions

View file

@ -103,7 +103,7 @@ sub args {
sub run_command {
my $pgm = shift;
my $fullpath = "$ENV{GL_BINDIR}/commands/$pgm";
_die "$pgm not found or not executable" if not -x $fullpath;
_die "'$pgm' not found or not executable" if not -x $fullpath;
_system( $fullpath, @_ );
exit 0;
}

View file

@ -161,7 +161,7 @@ sub parse_soc {
exit 0;
}
_die "unknown git/gitolite command: $soc";
_die "unknown git/gitolite command: '$soc'";
}
sub sanity {

View file

@ -62,7 +62,7 @@ sub parse {
my @validkeys = split( ' ', ( $rc{GIT_CONFIG_KEYS} || '' ) );
push @validkeys, "gitolite-options\\..*";
my @matched = grep { $key =~ /^$_$/ } @validkeys;
_die "git config $key not allowed\ncheck GIT_CONFIG_KEYS in the rc file" if ( @matched < 1 );
_die "git config '$key' not allowed\ncheck GIT_CONFIG_KEYS in the rc file" if ( @matched < 1 );
_die "bad value '$value'" if $value =~ $UNSAFE_PATT;
add_config( 1, $key, $value );
} elsif ( $line =~ /^subconf (\S+)$/ ) {

View file

@ -52,7 +52,7 @@ sub incsub {
my $is_subconf = ( +shift eq 'subconf' );
my ( $new_subconf, $include_glob, $current_subconf, $out ) = @_;
_die "subconf $current_subconf attempting to run 'subconf'\n" if $is_subconf and $current_subconf ne 'master';
_die "subconf '$current_subconf' attempting to run 'subconf'\n" if $is_subconf and $current_subconf ne 'master';
_die "invalid include/subconf file/glob '$include_glob'"
unless $include_glob =~ /^"(.+)"$/
@ -63,7 +63,7 @@ sub incsub {
for my $file ( glob($include_glob) ) {
_warn("included file not found: '$file'"), next unless -f $file;
_die "invalid include/subconf filename $file" unless $file =~ m(([^/]+).conf$);
_die "invalid include/subconf filename '$file'" unless $file =~ m(([^/]+).conf$);
my $basename = $1;
next if already_included($file);

View file

@ -73,7 +73,7 @@ sub access {
load($repo);
# sanity check the only piece the user can control
_die "invalid characters in ref or filename: $ref\n" unless $ref =~ $REF_OR_FILENAME_PATT;
_die "invalid characters in ref or filename: '$ref'\n" unless $ref =~ $REF_OR_FILENAME_PATT;
# when a real repo doesn't exist, ^C is a pre-requisite for any other
# check to give valid results.
@ -193,11 +193,11 @@ sub load_common {
my $cc = "conf/gitolite.conf-compiled.pm";
_die "parse $cc failed: " . ( $! or $@ ) unless do $cc;
_die "parse '$cc' failed: " . ( $! or $@ ) unless do $cc;
if ( data_version_mismatch() ) {
_system("gitolite setup");
_die "parse $cc failed: " . ( $! or $@ ) unless do $cc;
_die "parse '$cc' failed: " . ( $! or $@ ) unless do $cc;
_die "data version update failed; this is serious" if data_version_mismatch();
}
}
@ -223,7 +223,7 @@ sub load_1 {
_warn "split conf not set, gl-conf present for '$repo'" if not $split_conf{$repo};
my $cc = "gl-conf";
_die "parse $cc failed: " . ( $! or $@ ) unless do $cc;
_die "parse '$cc' failed: " . ( $! or $@ ) unless do $cc;
$last_repo = $repo;
$repos{$repo} = $one_repo{$repo};

View file

@ -137,7 +137,7 @@ sub expand_list {
for my $item (@list) {
if ( $item =~ /^@/ and $item ne '@all' ) # nested group
{
_die "undefined group $item" unless $groups{$item};
_die "undefined group '$item'" unless $groups{$item};
# add those names to the list
push @new_list, sort keys %{ $groups{$item} };
} else {

View file

@ -62,9 +62,9 @@ sub check_vrefs {
} else {
my ( $dummy, $pgm, @args ) = split '/', $vref;
$pgm = "$ENV{GL_BINDIR}/VREF/$pgm";
-x $pgm or _die "$vref: helper program missing or unexecutable";
-x $pgm or _die "'$vref': helper program missing or unexecutable";
open( my $fh, "-|", $pgm, @_, $vref, @args ) or _die "$vref: can't spawn helper program: $!";
open( my $fh, "-|", $pgm, @_, $vref, @args ) or _die "'$vref': can't spawn helper program: $!";
while (<$fh>) {
# print non-vref lines and skip processing (for example,
# normal STDOUT by a normal update hook)

View file

@ -63,7 +63,7 @@ my $rc = glrc('filename');
do $rc if -r $rc;
if ( defined($GL_ADMINDIR) ) {
say2 "";
say2 "FATAL: $rc seems to be for older gitolite; please see doc/g2migr.mkd\n" . "(online at http://sitaramc.github.com/gitolite/g3/g2migr.html)";
say2 "FATAL: '$rc' seems to be for older gitolite; please see doc/g2migr.mkd\n" . "(online at http://sitaramc.github.com/gitolite/g2migr.html)";
exit 1;
}
@ -132,7 +132,7 @@ sub glrc {
} elsif ( $cmd eq 'current-data-version' ) {
return $current_data_version;
} else {
_die "unknown argument to glrc: $cmd";
_die "unknown argument to glrc: '$cmd'";
}
}
@ -178,7 +178,7 @@ sub trigger {
if ( exists $rc{$rc_section} ) {
if ( ref( $rc{$rc_section} ) ne 'ARRAY' ) {
_die "$rc_section section in rc file is not a perl list";
_die "'$rc_section' section in rc file is not a perl list";
} else {
for my $s ( @{ $rc{$rc_section} } ) {
my ( $pgm, @args ) = split ' ', $s;

View file

@ -69,11 +69,11 @@ sub args {
usage() if $help or ( $pubkey and $admin );
if ($pubkey) {
$pubkey =~ /\.pub$/ or _die "$pubkey name does not end in .pub";
$pubkey =~ /\@/ and _die "$pubkey name contains '\@'";
tsh_try("cat $pubkey") or _die "$pubkey not a readable file";
tsh_lines() == 1 or _die "$pubkey must have exactly one line";
tsh_try("ssh-keygen -l -f $pubkey") or _die "$pubkey does not seem to be a valid ssh pubkey file";
$pubkey =~ /\.pub$/ or _die "'$pubkey' name does not end in .pub";
$pubkey =~ /\@/ and _die "'$pubkey' name contains '\@'";
tsh_try("cat $pubkey") or _die "'$pubkey' not a readable file";
tsh_lines() == 1 or _die "'$pubkey' must have exactly one line";
tsh_try("ssh-keygen -l -f $pubkey") or _die "'$pubkey' does not seem to be a valid ssh pubkey file";
$admin = $pubkey;
$admin =~ s(.*/)();

View file

@ -53,16 +53,16 @@ if (@gl_keys) {
my $out = join( "\n", @non_gl, "# gitolite start", @gl_keys, "# gitolite end" ) . "\n";
my $ak = slurp($akfile);
_die "$akfile changed between start and end of this program!" if $ak ne $old_ak;
_die "'$akfile' changed between start and end of this program!" if $ak ne $old_ak;
_print( $akfile, $out );
}
# ----------------------------------------------------------------------
sub sanity {
_die "$glshell not found; this should NOT happen..." if not -f $glshell;
_die "$glshell found but not readable; this should NOT happen..." if not -r $glshell;
_die "$glshell found but not executable; this should NOT happen..." if not -x $glshell;
_die "'$glshell' not found; this should NOT happen..." if not -f $glshell;
_die "'$glshell' found but not readable; this should NOT happen..." if not -r $glshell;
_die "'$glshell' found but not executable; this should NOT happen..." if not -x $glshell;
_warn "$akdir missing; creating a new one" if not -d $akdir;
_warn "$akfile missing; creating a new one" if not -f $akfile;
@ -103,7 +103,7 @@ sub fp_file {
my $f = shift;
my $fp = `ssh-keygen -l -f '$f'`;
chomp($fp);
_die "fingerprinting failed for $f" unless $fp =~ /([0-9a-f][0-9a-f](:[0-9a-f][0-9a-f])+)/;
_die "fingerprinting failed for '$f'" unless $fp =~ /([0-9a-f][0-9a-f](:[0-9a-f][0-9a-f])+)/;
$fp = $1;
return $fp;
}

View file

@ -29,7 +29,7 @@ try "
glt ls-remote u1 file:///foo/u1/u1a;ok; gsh
/Initialized empty Git repository in .*/foo/u1/u1a.git/
# vrc doesn't have the fork command
glt fork u1 foo/u1/u1a foo/u1/u1a2; !ok; /FATAL: unknown git/gitolite command: fork/
glt fork u1 foo/u1/u1a foo/u1/u1a2; !ok; /FATAL: unknown git/gitolite command: \\'fork/
";
# allow fork as a valid command

View file

@ -26,7 +26,7 @@ confreset;confadd '
try "ADMIN_PUSH set1; /FATAL/" or die text();
try "
/git config foo.bar not allowed/
/git config \\'foo.bar\\' not allowed/
/check GIT_CONFIG_KEYS in the rc file/
";

View file

@ -78,7 +78,7 @@ confadd 'g2.conf', '
';
try "
ADMIN_PUSH set3; ok; /FATAL: subconf g2 attempting to run 'subconf'/
ADMIN_PUSH set3; ok; /FATAL: subconf \\'g2\\' attempting to run 'subconf'/
";
# ----------------------------------------------------------------------

View file

@ -50,7 +50,7 @@ glt push u1 origin master:dd,ee
# push to branch dd=ee fail
glt push u1 origin master:dd=ee
/invalid characters in ref or filename: refs/heads/dd=ee/
/invalid characters in ref or filename: \\'refs/heads/dd=ee/
reject
";
@ -84,7 +84,7 @@ glt push u1 origin HEAD
tc aa=bb
glt push u1 origin HEAD
/To file:///aa/
/invalid characters in ref or filename: VREF/NAME/aa=bb/
/invalid characters in ref or filename: \\'VREF/NAME/aa=bb/
reject
# push to branch dd,ee ok
@ -96,6 +96,6 @@ glt push u1 origin master:dd,ee
# push to branch dd=ee fail
glt push u1 origin master:dd=ee
/invalid characters in ref or filename: refs/heads/dd=ee/
/invalid characters in ref or filename: \\'refs/heads/dd=ee/
reject
";

View file

@ -60,11 +60,11 @@ try "
# a bad key
ls -al > bad.pub
$pgm; !ok; /fingerprinting failed for keydir/bad.pub/
$pgm; !ok; /fingerprinting failed for \\'keydir/bad.pub\\'/
wc < $ak; ok; /^ *9 .*/;
# a good key doesn't get added
ssh-keygen -N '' -q -f good
$pgm; !ok; /fingerprinting failed for keydir/bad.pub/
$pgm; !ok; /fingerprinting failed for \\'keydir/bad.pub\\'/
wc < $ak; ok; /^ *9 .*/;
# till the bad key is removed
rm bad.pub