summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-01 14:00:47 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-31 13:49:37 +0200
commitde2c7e41ab4fe0e1e899e1d87c991e32cd343365 (patch)
treee51a8b1b5d52451901b96ad60d54c88fdd4afa26 /apt-pkg/pkgcachegen.cc
parent574ce54dae3089d6d2886bac6b8895510b0ececb (diff)
do not treat same-version local debs as downgrade
As the volatile sources are parsed last they were sorted behind the dpkg/status file and hence are treated as a downgrade, which isn't really what you want to happen as from a user POV its an upgrade. (cherry picked from commit cb9ac09bd6a36e73c2dce1d529acde6e4d15e32d)
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index f9d8a8b4b..f0b5a982e 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -392,8 +392,21 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator
if (Res > 0)
break;
// Versionstrings are equal - is hash also equal?
- if (Res == 0 && List.SameVersion(Hash, Ver) == true)
- break;
+ if (Res == 0)
+ {
+ if (List.SameVersion(Hash, Ver) == true)
+ break;
+ // sort (volatile) sources above not-sources like the status file
+ if ((CurrentFile->Flags & pkgCache::Flag::NotSource) == 0)
+ {
+ auto VF = Ver.FileList();
+ for (; VF.end() == false; ++VF)
+ if (VF.File().Flagged(pkgCache::Flag::NotSource) == false)
+ break;
+ if (VF.end() == true)
+ break;
+ }
+ }
// proceed with the next till we have either the right
// or we found another version (which will be lower)
}