From b2fd852459a6b9234255644730f48f071ccad64d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 14 Apr 2016 17:32:17 +0200 Subject: silently skip acquire of empty index files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is just no point in taking the time to acquire empty files – especially as it will be tiny non-empty compressed files usually. --- apt-pkg/acquire-item.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'apt-pkg') 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; } } -- cgit v1.2.3