summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-14 17:32:17 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-14 21:56:01 +0200
commitb2fd852459a6b9234255644730f48f071ccad64d (patch)
tree5ea9c6b0704894b641319fbe35eee281c414a0c2 /apt-pkg/acquire-item.cc
parent479f6fa454cd6ee9e1bc4d9ecda856d34584092e (diff)
silently skip acquire of empty index files
There is just no point in taking the time to acquire empty files – especially as it will be tiny non-empty compressed files usually.
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 0569c6dda..bc5e91fed 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1151,11 +1151,17 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/
else
{
auto const hashes = GetExpectedHashesFor(Target->MetaKey);
- if (hashes.usable() == false && hashes.empty() == false)
+ if (hashes.empty() == false)
{
- _error->Warning(_("Skipping acquire of configured file '%s' as repository '%s' provides only weak security information for it"),
+ if (hashes.usable() == false)
+ {
+ _error->Warning(_("Skipping acquire of configured file '%s' as repository '%s' provides only weak security information for it"),
Target->MetaKey.c_str(), TransactionManager->Target.Description.c_str());
- continue;
+ continue;
+ }
+ // empty files are skipped as acquiring the very small compressed files is a waste of time
+ else if (hashes.FileSize() == 0)
+ continue;
}
}