ssh-authkeys done!

This commit is contained in:
Sitaram Chamarty 2012-03-11 21:33:15 +05:30
parent cbd4d43687
commit 0aeb0cd5e2
8 changed files with 274 additions and 10 deletions

View file

@ -19,7 +19,7 @@ use warnings;
# ----------------------------------------------------------------------
sub post_update {
trace(3);
trace(3, @ARGV);
# this is the *real* post_update hook for gitolite
tsh_try("git ls-tree --name-only master");
@ -31,6 +31,24 @@ sub post_update {
}
_system("$ENV{GL_BINDIR}/gitolite compile");
# now run optional post-compile features
if (exists $rc{POST_COMPILE}) {
if (ref($rc{POST_COMPILE}) ne 'ARRAY') {
_warn "bad syntax for specifying post compile scripts; see docs";
} else {
for my $s (@{ $rc{POST_COMPILE} }) {
# perl-ism; apart from keeping the full path separate from the
# simple name, this also protects %rc from change by implicit
# aliasing, which would happen if you touched $s itself
my $sfp = "$ENV{GL_BINDIR}/post-compile/$s";
_warn("skipped post-compile script '$s'"), next if not -x $sfp;
_system($sfp, @ARGV); # they better all return with 0 exit codes!
}
}
}
exit 0;
}
@ -64,5 +82,5 @@ use Gitolite::Hooks::PostUpdate;
# gitolite post-update hook (only for the admin repo)
# ----------------------------------------------------------------------
post_update(@ARGV); # is not expected to return
post_update(); # is not expected to return
exit 1; # so if it does, something is wrong