On Fri, Oct 13, 2017 at 03:56:48PM +0200, [email protected] wrote:
> Dear Mark,
>
> sorry, no luck. Can you at least reproduce the behavior with the original
> (or/and patched) script?
Chris,
I can only reproduce it indirectly as I think it is only triggered when a
particular combination of index files are present/absent in the cache. I thought
the issue was just not reading the by-hash index files, but I think your cache
doesn't even have them as you just have diff_by-hash and InRelease files.
Can you verify that?
This patch fixes that situation for me:
Changes in #878169~2
Modified apt-cacher-cleanup.pl
diff --git a/apt-cacher-cleanup.pl b/apt-cacher-cleanup.pl
index 6aceda4..4f8647d 100755
--- a/apt-cacher-cleanup.pl
+++ b/apt-cacher-cleanup.pl
@@ -689,9 +689,9 @@ if (!$offline) {
# and Release for each Packages/Sources
my %missing;
CHECKFILE:
- foreach (glob('*diff_Index *{Packages,Sources}{,.gz,.xz,.bz2}')) {
+ foreach (glob('*diff_{Index,by-hash_*}
*{Packages,Sources}{,.gz,.xz,.bz2}')) {
my $file = $_;
- if (s/\.diff_Index$/{,.gz,.xz,.bz2}/) {
+ if
(s/\.diff_(?:Index$|(?:by-hash_(?i:MD5SUM_[0-9a-f]{32}|SHA1_[0-9a-f]{40}|SHA256_[0-9a-f]{64})))/{,.gz,.xz,.bz2}/)
{
printmsg "Checking for $_ for $file\n";
}
elsif
(s/(?:dists_[^_]+_(?:updates_)?\K(?:[^_]+_){2})?(?:Packages|Sources)(?:\.(?:bz2|(?:x|g)z))?$/{In,}Release/)
{
@@ -703,9 +703,14 @@ if (!$offline) {
next CHECKFILE;
}
}
- $missing{(glob)[-1]} = 1;
+ $missing{(glob)[0]} = 1;
+ }
+ foreach (keys %missing) {
+ foreach (glob($_ . '{.xz,.gz,.bz2,}')) {
+ get($_);
+ last if -f;
+ }
}
- get($_) foreach keys %missing;
}
Does that help?
Mark