From 401c2f46d7f3cbbeeec807329fec502c9db6818d Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 1 Sep 2009 20:33:19 +0530 Subject: [PATCH] install: update hooks in all repos on upgrade --- src/install.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/install.pl b/src/install.pl index 6dec899..4624a74 100755 --- a/src/install.pl +++ b/src/install.pl @@ -51,3 +51,16 @@ unless (-f $GL_CONF) { (the "admin" document should help here...) EOF } + +# finally, any potential changes to src/update-hook.pl must be propagated to +# all the repos' hook directories +my $repo_base_abs = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" ); +# err, no need to get all worked up if you can't CD there -- this may be the +# very first run and it hasn't been created yet +if (chdir("$repo_base_abs")) { + for my $repo (`find . -type d -name "*.git"`) { + chomp ($repo); + system("cp $GL_ADMINDIR/src/update-hook.pl $repo/hooks/update"); + chmod 0755, "$repo/hooks/update"; + } +}