move hooks out of src
src/hooks is now hooks/common src/ga... is now hooks/gitolite-admin/post-update
This commit is contained in:
parent
65b8c0c48a
commit
74d70e3b9f
|
@ -176,7 +176,7 @@ if ( -d "$repo_base_abs/$repo.git" ) {
|
||||||
# auto-vivify new repo if you have C access (and wildrepos is on)
|
# auto-vivify new repo if you have C access (and wildrepos is on)
|
||||||
if ( $GL_WILDREPOS and $repos{$repo}{C}{$user} || $repos{$repo}{C}{'@all'} ) {
|
if ( $GL_WILDREPOS and $repos{$repo}{C}{$user} || $repos{$repo}{C}{'@all'} ) {
|
||||||
wrap_chdir("$repo_base_abs");
|
wrap_chdir("$repo_base_abs");
|
||||||
new_repo($repo, "$GL_ADMINDIR/src/hooks", $user);
|
new_repo($repo, "$GL_ADMINDIR/hooks/common", $user);
|
||||||
wrap_chdir($ENV{HOME});
|
wrap_chdir($ENV{HOME});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,7 +396,7 @@ for my $repo (sort keys %repos) {
|
||||||
next if $repo =~ m(^EXTCMD/); # these are not real repos
|
next if $repo =~ m(^EXTCMD/); # these are not real repos
|
||||||
unless (-d "$repo.git") {
|
unless (-d "$repo.git") {
|
||||||
print STDERR "creating $repo...\n";
|
print STDERR "creating $repo...\n";
|
||||||
new_repo($repo, "$GL_ADMINDIR/src/hooks");
|
new_repo($repo, "$GL_ADMINDIR/hooks/common");
|
||||||
# new_repo would have chdir'd us away; come back
|
# new_repo would have chdir'd us away; come back
|
||||||
wrap_chdir("$repo_base_abs");
|
wrap_chdir("$repo_base_abs");
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,12 +169,12 @@ basic_sanity() {
|
||||||
# MANUAL: make sure you're in the gitolite directory, at the top level.
|
# MANUAL: make sure you're in the gitolite directory, at the top level.
|
||||||
# The following files should all be visible:
|
# The following files should all be visible:
|
||||||
|
|
||||||
ls src/ga-post-update-hook \
|
ls hooks/gitolite-admin/post-update \
|
||||||
|
hooks/common/update \
|
||||||
src/gitolite.pm \
|
src/gitolite.pm \
|
||||||
src/gl-install \
|
src/gl-install \
|
||||||
src/gl-auth-command \
|
src/gl-auth-command \
|
||||||
src/gl-compile-conf \
|
src/gl-compile-conf \
|
||||||
src/hooks/update \
|
|
||||||
conf/example.conf \
|
conf/example.conf \
|
||||||
conf/example.gitolite.rc >/dev/null ||
|
conf/example.gitolite.rc >/dev/null ||
|
||||||
die "cant find at least some files in gitolite sources/config; aborting"
|
die "cant find at least some files in gitolite sources/config; aborting"
|
||||||
|
@ -282,7 +282,7 @@ copy_gl() {
|
||||||
# have to create the directory first.
|
# have to create the directory first.
|
||||||
|
|
||||||
ssh -p $port $user@$host mkdir -p gitolite-install
|
ssh -p $port $user@$host mkdir -p gitolite-install
|
||||||
scp $quiet -P $port -r src conf doc $user@$host:gitolite-install/
|
scp $quiet -P $port -r src conf doc hooks $user@$host:gitolite-install/
|
||||||
rm -f src/VERSION
|
rm -f src/VERSION
|
||||||
|
|
||||||
# MANUAL: now log on to the server (ssh git@server) and get a command
|
# MANUAL: now log on to the server (ssh git@server) and get a command
|
||||||
|
|
|
@ -48,12 +48,12 @@ my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE"
|
||||||
wrap_mkdir($repo_base_abs);
|
wrap_mkdir($repo_base_abs);
|
||||||
wrap_mkdir($GL_ADMINDIR);
|
wrap_mkdir($GL_ADMINDIR);
|
||||||
# mkdir $GL_ADMINDIR's subdirs
|
# mkdir $GL_ADMINDIR's subdirs
|
||||||
for my $dir qw(conf doc keydir logs src) {
|
for my $dir qw(conf doc keydir logs src hooks hooks/common hooks/gitolite-admin) {
|
||||||
wrap_mkdir("$GL_ADMINDIR/$dir");
|
wrap_mkdir("$GL_ADMINDIR/$dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
# "src" and "doc" will be overwritten on each install, but not conf
|
# "src" and "doc" will be overwritten on each install, but not conf
|
||||||
system("cp -R src doc $GL_ADMINDIR");
|
system("cp -R src doc hooks $GL_ADMINDIR");
|
||||||
|
|
||||||
unless (-f $GL_CONF) {
|
unless (-f $GL_CONF) {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
|
@ -72,7 +72,7 @@ chdir("$repo_base_abs") or die "chdir $repo_base_abs failed: $!\n";
|
||||||
for my $repo (`find . -type d -name "*.git"`) {
|
for my $repo (`find . -type d -name "*.git"`) {
|
||||||
chomp ($repo);
|
chomp ($repo);
|
||||||
# propagate our own, plus any local admin-defined, hooks
|
# propagate our own, plus any local admin-defined, hooks
|
||||||
ln_sf("$GL_ADMINDIR/src/hooks", "*", "$repo/hooks");
|
ln_sf("$GL_ADMINDIR/hooks/common", "*", "$repo/hooks");
|
||||||
chmod 0755, "$repo/hooks/update";
|
chmod 0755, "$repo/hooks/update";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,13 +80,13 @@ for my $repo (`find . -type d -name "*.git"`) {
|
||||||
if ( -d "gitolite-admin.git/hooks" ) {
|
if ( -d "gitolite-admin.git/hooks" ) {
|
||||||
print "copying post-update hook to gitolite-admin repo...\n";
|
print "copying post-update hook to gitolite-admin repo...\n";
|
||||||
unlink "gitolite-admin.git/hooks/post-update";
|
unlink "gitolite-admin.git/hooks/post-update";
|
||||||
symlink "$GL_ADMINDIR/src/ga-post-update-hook", "gitolite-admin.git/hooks/post-update"
|
symlink "$GL_ADMINDIR/hooks/gitolite-admin/post-update", "gitolite-admin.git/hooks/post-update"
|
||||||
or die "could not symlink post-update hook\n";
|
or die "could not symlink post-update hook\n";
|
||||||
chmod 0755, "gitolite-admin.git/hooks/post-update";
|
chmod 0755, "gitolite-admin.git/hooks/post-update";
|
||||||
}
|
}
|
||||||
|
|
||||||
# fixup program renames
|
# fixup program renames
|
||||||
for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl) {
|
for my $oldname qw(pta-hook.sh conf-convert.pl 00-easy-install.sh 99-emergency-addkey.sh install.pl update-hook.pl hooks/update ga-post-update-hook) {
|
||||||
unlink "$GL_ADMINDIR/src/$oldname";
|
unlink "$GL_ADMINDIR/src/$oldname";
|
||||||
unlink "$ENV{HOME}/gitolite-install/src/$oldname";
|
unlink "$ENV{HOME}/gitolite-install/src/$oldname";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue