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