(perltidy)
This commit is contained in:
parent
afcd974afa
commit
8714b77eae
|
@ -77,8 +77,8 @@ sub _die {
|
|||
sub usage {
|
||||
_warn(shift) if @_;
|
||||
my ( $script, $function ) = ( caller(1) )[ 1, 3 ];
|
||||
if (not $script) {
|
||||
$script = ( caller ) [1];
|
||||
if ( not $script ) {
|
||||
$script = (caller)[1];
|
||||
$function = 'usage';
|
||||
}
|
||||
dbg( "u s a g e", $script, $function );
|
||||
|
@ -115,7 +115,7 @@ sub _system {
|
|||
die "child died with signal " . ( $? & 127 ) . "\n" if $ENV{D};
|
||||
} else {
|
||||
die "child exited with value " . ( $? >> 8 ) . "\n" if $ENV{D};
|
||||
exit ( $? >> 8 );
|
||||
exit( $? >> 8 );
|
||||
}
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ _die "$rc seems to be for older gitolite" if defined($GL_ADMINDIR);
|
|||
# let values specified in rc file override our internal ones
|
||||
@rc{ keys %RC } = values %RC;
|
||||
|
||||
# testing sometimes requires all of it to be overridden silently; use an
|
||||
# env var that is highly unlikely to appear in real life :)
|
||||
do $ENV{G3T_RC} if exists $ENV{G3T_RC} and -r $ENV{G3T_RC};
|
||||
# testing sometimes requires all of it to be overridden silently; use an
|
||||
# env var that is highly unlikely to appear in real life :)
|
||||
do $ENV{G3T_RC} if exists $ENV{G3T_RC} and -r $ENV{G3T_RC};
|
||||
|
||||
# fix PATH (TODO: do it only if 'gitolite' isn't in PATH)
|
||||
$ENV{PATH} = "$ENV{GL_BINDIR}:$ENV{PATH}";
|
||||
|
|
|
@ -79,7 +79,7 @@ sub setup_glrc {
|
|||
|
||||
sub setup_gladmin {
|
||||
my ( $admin, $pubkey, $argv ) = @_;
|
||||
trace( 1, $admin || '<no admin name given>');
|
||||
trace( 1, $admin || '<no admin name given>' );
|
||||
_die "no existing conf file found, '-a' required"
|
||||
if not $admin and not -f "$rc{GL_ADMIN_BASE}/conf/gitolite.conf";
|
||||
|
||||
|
@ -96,7 +96,7 @@ sub setup_gladmin {
|
|||
_chdir( $rc{GL_ADMIN_BASE} );
|
||||
|
||||
tsh_try("cd \$GL_BINDIR; git describe --tags --long --dirty=-dt 2>/dev/null")
|
||||
and _print("VERSION", tsh_text());
|
||||
and _print( "VERSION", tsh_text() );
|
||||
|
||||
_mkdir("conf");
|
||||
my $conf;
|
||||
|
|
|
@ -72,12 +72,12 @@ sub dump {
|
|||
}
|
||||
|
||||
sub _confargs {
|
||||
return @_ if ($_[1]);
|
||||
return @_ if ( $_[1] );
|
||||
return 'gitolite.conf', $_[0];
|
||||
}
|
||||
|
||||
sub confreset {
|
||||
system("rm", "-rf", "conf");
|
||||
system( "rm", "-rf", "conf" );
|
||||
mkdir("conf");
|
||||
system("mv ~/repositories/gitolite-admin.git ~/repositories/.ga");
|
||||
system("mv ~/repositories/testing.git ~/repositories/.te");
|
||||
|
@ -93,7 +93,7 @@ sub confreset {
|
|||
}
|
||||
|
||||
sub confadd {
|
||||
my ($file, $string) = _confargs(@_);
|
||||
my ( $file, $string ) = _confargs(@_);
|
||||
put "|cat >> conf/$file", $string;
|
||||
}
|
||||
|
||||
|
|
|
@ -475,11 +475,11 @@ sub cmp {
|
|||
my $text = text();
|
||||
my $in = shift;
|
||||
|
||||
if ($text eq $in) {
|
||||
if ( $text eq $in ) {
|
||||
ok();
|
||||
} else {
|
||||
fail('cmp failed', '');
|
||||
dbg(4, "\n\ntext = <<<$text>>>, in = <<<$in>>>\n\n");
|
||||
fail( 'cmp failed', '' );
|
||||
dbg( 4, "\n\ntext = <<<$text>>>, in = <<<$in>>>\n\n" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ my $ret = '';
|
|||
|
||||
$ret = access( $repo, $user, $aa, $ref );
|
||||
|
||||
if ($ret =~ /DENIED/) {
|
||||
if ( $ret =~ /DENIED/ ) {
|
||||
print "$ret\n" unless $quiet;
|
||||
exit 1;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ usage() if @ARGV;
|
|||
my $user = $ENV{GL_USER} or _die "GL_USER not set";
|
||||
my $ref = 'any';
|
||||
|
||||
print "hello $user, this is gitolite3 " . version() . " on git " . substr(`git --version`, 12) . "\n";
|
||||
print "hello $user, this is gitolite3 " . version() . " on git " . substr( `git --version`, 12 ) . "\n";
|
||||
|
||||
my $lr = lister_dispatch('list-repos');
|
||||
my $lm = lister_dispatch('list-members');
|
||||
|
@ -27,7 +27,7 @@ my $lm = lister_dispatch('list-members');
|
|||
for ( @{ $lr->() } ) {
|
||||
my $perm = '';
|
||||
for my $aa (qw(R W ^C)) {
|
||||
my $ret = access($_, $user, $aa, $ref);
|
||||
my $ret = access( $_, $user, $aa, $ref );
|
||||
$perm .= ( $ret =~ /DENIED/ ? " " : " $aa" );
|
||||
}
|
||||
next unless $perm =~ /\S/;
|
||||
|
|
|
@ -103,11 +103,11 @@ the gitolite-admin repo).
|
|||
sub post_compile {
|
||||
usage() if ( not @_ or $_[0] eq '-h' );
|
||||
|
||||
run_subdir('post-compile', @_);
|
||||
run_subdir( 'post-compile', @_ );
|
||||
}
|
||||
|
||||
sub run_command {
|
||||
run_subdir('commands', @_);
|
||||
run_subdir( 'commands', @_ );
|
||||
}
|
||||
|
||||
sub run_subdir {
|
||||
|
|
|
@ -79,9 +79,9 @@ sub parse_soc {
|
|||
|
||||
if ( $soc =~ m(^(git-(?:upload|receive)-pack) '/?(.*?)(?:\.git)?'$) ) {
|
||||
# TODO git archive
|
||||
my($verb, $repo) = ($1, $2);
|
||||
my ( $verb, $repo ) = ( $1, $2 );
|
||||
_die "invalid repo name: '$repo'" if $repo !~ $REPONAME_PATT;
|
||||
return ($verb, $repo);
|
||||
return ( $verb, $repo );
|
||||
}
|
||||
|
||||
# after this we should not return; caller expects us to handle it all here
|
||||
|
@ -90,8 +90,8 @@ sub parse_soc {
|
|||
_die "suspicious characters loitering about '$soc'" if $soc !~ $REMOTE_COMMAND_PATT;
|
||||
|
||||
my @words = split ' ', $soc;
|
||||
if ($rc{COMMANDS}{$words[0]}) {
|
||||
_system("gitolite", @words);
|
||||
if ( $rc{COMMANDS}{ $words[0] } ) {
|
||||
_system( "gitolite", @words );
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
sub sugar_script {
|
||||
my $lines = shift;
|
||||
|
||||
my @out = @{ $lines };
|
||||
my @out = @{$lines};
|
||||
unshift @out, groupnames();
|
||||
|
||||
return \@out;
|
||||
|
@ -23,7 +23,7 @@ sub groupnames {
|
|||
next if $1 eq 'keydir';
|
||||
$members{$1} .= " $2";
|
||||
}
|
||||
for my $m (sort keys %members) {
|
||||
for my $m ( sort keys %members ) {
|
||||
push @out, "\@$m =" . $members{$m};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue