]> git.saurik.com Git - apt.git/commit - apt-pkg/acquire-item.cc
parse .diff/Index hashes in reverse order
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 13 Dec 2015 17:53:08 +0000 (18:53 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Sun, 13 Dec 2015 17:53:08 +0000 (18:53 +0100)
commit37141fe491b515beb04bd1d9f016a96154de7c4a
treed9347dbc26c9e772c5405a5b71dffd581b3e1020
parent646ebd92c8ad9897078746ef440231a2fc34b683
parse .diff/Index hashes in reverse order

Reversing the parsing order ensures that we parse weaker hashes (like
SHA1) before we touch newer/stronger hashes (like SHA256) as the weaker
ones will usually be there for a longer time already with data already
present, which we would discard if we start with the strong one first.

The discarding is visible in the debug logs:
File X wasn't in the list for the first parsed hash! (history)
File X wasn't in the list for the first parsed hash! (patches)
which if file X is part of the patch-path means apt will not find a path and
fallback to acquire the whole file instead needlessly.
If file X isn't part of the patch-path that is no problem, so that
effects only the update-call which updates with patches coming from
before and after the addition of a new hash.
apt-pkg/acquire-item.cc