diff options
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 370819e0b..2d1f2a5d4 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -336,7 +336,16 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) { if (VerPins[Ver->ID].Type != pkgVersionMatch::None) return VerPins[Ver->ID].Priority; - return 0; + + + int priority = INT_MIN; + for (pkgCache::VerFileIterator file = Ver.FileList(); file.end() == false; file++) + { + if (GetPriority(file.File()) > priority) + priority = GetPriority(file.File()); + } + + return priority == INT_MIN ? 0 : priority; } APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File) { |