summaryrefslogtreecommitdiff
path: root/src/triggers/post-compile/update-git-daemon-access-list
diff options
context:
space:
mode:
Diffstat (limited to 'src/triggers/post-compile/update-git-daemon-access-list')
-rwxr-xr-xsrc/triggers/post-compile/update-git-daemon-access-list17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/triggers/post-compile/update-git-daemon-access-list b/src/triggers/post-compile/update-git-daemon-access-list
index 446b0da..ade97a8 100755
--- a/src/triggers/post-compile/update-git-daemon-access-list
+++ b/src/triggers/post-compile/update-git-daemon-access-list
@@ -11,21 +11,20 @@ use Gitolite::Common;
use strict;
use warnings;
-# ----------------------------------------------------------------------
-# skip if arg-0 is POST_CREATE and no arg-2 (user name) exists; this means
-# it's been triggered by a *normal* (not "wild") repo creation, which in turn
-# means a POST_COMPILE should be following so there's no need to waste time
-# running this once for each new repo
-exit 0 if @ARGV and $ARGV[0] eq 'POST_CREATE' and not $ARGV[2];
-
my $EO = "git-daemon-export-ok";
my $RB = $rc{GL_REPO_BASE};
-for my $d (`gitolite list-phy-repos | gitolite access % daemon R any`) {
+my $cmd = "gitolite list-phy-repos";
+if ( @ARGV and $ARGV[0] eq 'POST_CREATE' ) {
+ # only one repo to do
+ $cmd = "echo $ARGV[1]";
+}
+
+for my $d (`$cmd | gitolite access % daemon R any`) {
my @F = split "\t", $d;
if ($F[2] =~ /DENIED/) {
unlink "$RB/$F[0].git/$EO";
- } else {
+ } elsif (! -f "$RB/$F[0].git/$EO") {
textfile( file => $EO, repo => $F[0], text => "" );
}
}