(minor) single quotes around variables in error messages
(plus a couple of other minor fixups)
This commit is contained in:
parent
20d2120ea5
commit
d04e79d291
15 changed files with 33 additions and 33 deletions
|
@ -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+)$/ ) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(.*/)();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue