package apt-cacher tag 669372 pending thanks Thanks for this. I had already spotted this problem and had a fix waiting for 1.7.4.
The full patch I have is below, perhaps you could verify it fixes it for you. Mark diff --git a/apt-cacher-cleanup.pl b/apt-cacher-cleanup.pl index bdb23f7..aa39389 100755 --- a/apt-cacher-cleanup.pl +++ b/apt-cacher-cleanup.pl @@ -184,17 +197,23 @@ sub pdiff { return; } my ($basename,$type) = ($name =~ /(^.+?)(\.(?:bz2|gz))?$/); - (my $release = $basename) =~ s/(?:main|contrib|non-free).*$/Release/; + (my $release = $basename) =~ s/(?:main|contrib|non-free).*$/{In,}Release/; (my $diffindex = $basename) .= '.diff_Index'; - for ($release, $diffindex) { - if (!-f $_ && !$offline) { # Refresh unless offline - get($_); - } - if (!-f $_) { - printmsg("$_ not available, aborting patch\n"); - return; + my ($release_fh, $diffin_fh); + + foreach my $glob_fh ([\$release, \$release_fh], [\$diffindex, \$diffin_fh]) { + foreach (glob(${$glob_fh->[0]})) { + get($_) unless $offline; + open(${$glob_fh->[1]}, '<', $_) + && do { + ${$glob_fh->[0]} = $_; + last; + } + || printmsg("Failed to open $_: $!\n"); } + return unless ${$glob_fh->[1]}->opened; + _flock(${$glob_fh->[1]}, LOCK_SH) || die("Cannot lock ${$glob_fh->[0]}: $!"); } # Read Release file @@ -208,11 +227,9 @@ sub pdiff { s/_/\//g; } # printmsg "Searching $release for $diffindex_patt and $name_patt\n"; - open(my $rfh, '<', $release) || die "Unable to open $release: $!"; - _flock($rfh, LOCK_SH); my ($diffindex_sha1, $name_sha1, $name_size); - while (<$rfh>) { + while (<$release_fh>) { if (/^\s(\w{40})\s+\d+\s$diffindex_patt\n/) { $diffindex_sha1 = $1; # printmsg "Found! $diffindex_patt $1\n"; @@ -224,8 +241,8 @@ sub pdiff { } last if ($name_sha1 && $diffindex_sha1); } - _flock($rfh, LOCK_UN); - close($rfh); + _flock($release_fh, LOCK_UN); + close($release_fh); if (!$name_sha1 || !$name_size || !$diffindex_sha1) { warn "SHA1s for $name_patt and/or $diffindex_patt not found in $release, aborting patch\n"; return; @@ -281,8 +298,6 @@ sub pdiff { # Read diff_Index my (@hist, @patch); - open(my $diffin_fh, '<', $diffindex) || die("Cannot open $diffindex: $!"); - _flock($diffin_fh, LOCK_SH); my $diffindex_digest = $sha1->addfile($diffin_fh)->hexdigest; if ($diffindex_digest ne $diffindex_sha1) { _flock($diffin_fh, LOCK_UN); @@ -608,7 +623,7 @@ if($> == 0 && !$cfg->{user} && !$force) { } foreach (glob) { if ( -f $_ ) { - print "Found $_\n"; + printmsg "Found $_\n"; next CHECKFILE; } } -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org