2012-03-12 16:24:30 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use lib $ENV{GL_BINDIR};
|
|
|
|
use Gitolite::Rc;
|
|
|
|
use Gitolite::Common;
|
|
|
|
use Gitolite::Conf::Load;
|
|
|
|
|
|
|
|
=for usage
|
|
|
|
Usage: gitolite info
|
|
|
|
|
|
|
|
- list all repos/repo groups you can access
|
|
|
|
- no options, no flags
|
|
|
|
=cut
|
|
|
|
|
|
|
|
usage() if @ARGV;
|
|
|
|
|
|
|
|
my $user = $ENV{GL_USER} or _die "GL_USER not set";
|
|
|
|
my $ref = 'any';
|
|
|
|
|
2012-03-15 15:34:30 +01:00
|
|
|
print "hello $user, this is gitolite3 " . version() . " on git " . substr( `git --version`, 12 ) . "\n";
|
2012-03-15 14:44:40 +01:00
|
|
|
|
2012-03-15 01:37:41 +01:00
|
|
|
my $lr = lister_dispatch('list-repos');
|
|
|
|
my $lm = lister_dispatch('list-members');
|
2012-03-12 16:24:30 +01:00
|
|
|
|
2012-03-15 01:37:41 +01:00
|
|
|
for ( @{ $lr->() } ) {
|
2012-03-12 16:24:30 +01:00
|
|
|
my $perm = '';
|
|
|
|
for my $aa (qw(R W ^C)) {
|
2012-03-15 15:34:30 +01:00
|
|
|
my $ret = access( $_, $user, $aa, $ref );
|
2012-03-12 16:24:30 +01:00
|
|
|
$perm .= ( $ret =~ /DENIED/ ? " " : " $aa" );
|
|
|
|
}
|
2012-03-15 01:37:41 +01:00
|
|
|
next unless $perm =~ /\S/;
|
|
|
|
if (/^\@/) {
|
|
|
|
print "\n$perm\t$_\n";
|
|
|
|
for ( @{ $lm->($_) } ) {
|
|
|
|
print "$perm\t$_\n";
|
|
|
|
}
|
|
|
|
print "\n";
|
|
|
|
} else {
|
|
|
|
print "$perm\t$_\n";
|
|
|
|
}
|
2012-03-12 16:24:30 +01:00
|
|
|
}
|