X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=blobdiff_plain;f=scripts%2Fgit-cache-proxy;h=e87a80329e313663515e8d23f96c8083335ca1d1;hp=b0c9502f8554b8f3f15345f784a624aa5dd6b10f;hb=9f36b90fd7a758bb7e0e1534ea2c7adadac4123e;hpb=dfbd234c7f11ce1aaa49937f1313a8214505c735 diff --git a/scripts/git-cache-proxy b/scripts/git-cache-proxy index b0c9502..e87a803 100755 --- a/scripts/git-cache-proxy +++ b/scripts/git-cache-proxy @@ -29,7 +29,7 @@ # git-cache-proxy # Copyright 2010 Tony Finch -# Copyright 2013 Ian Jackson +# Copyright 2013,2014 Ian Jackson # # git-cache-proxy is free software; you can redistribute it and/or # modify them under the terms of the GNU General Public License as @@ -360,6 +360,7 @@ sub clonefetch () { servinfo "fetch/clone failed: $fetchfail"; } } + alarm 0; if (!$exists) { rename $tmpd, $gitd or fail "rename fresh $tmpd to $gitd: $!"; @@ -415,14 +416,9 @@ sub housekeeping () { die "$dir: cannot rename to $tdir: $!\n"; } } - my $errs; - remove_tree($tdir, { safe=>1, error=>\$errs }); - if (!stat $tdir) { - foreach my $err (@$errs) { - my ($file, $message) = %$err; - logm 'info', "problem deleting: $file: $message"; - } - die "$dir: problem deleting file(s)\n"; + system qw(rm -rf --), $tdir; + if (stat $tdir) { + die "$dir: problem deleting file(s), rm exited $?\n"; } elsif ($! != ENOENT) { die "$tdir: cannot stat after deletion: $!\n"; } @@ -461,8 +457,10 @@ sub housekeepingcheck ($$) { } if ($dofork) { my $child = fork; - defined $child or hkfail "fork: $!"; + defined $child or fail "fork: $!"; if (!$child) { + open STDERR, "|logger -p daemon.warning -t '$us(housekeeping)'" + or die "fork: logger $!"; housekeeping(); exit 0; }