Commit 75272eef authored by Julian Andres Klode's avatar Julian Andres Klode

Return correct pin in apt.package.Version.policy_priority

Change the property to correctly return the pin for the
version, rather than the maximum pin of its packagefiles.
parent 63492dfc
......@@ -679,11 +679,7 @@ class Version(object):
"""Return the internal policy priority as a number.
See apt_preferences(5) for more information about what it means.
"""
priority = 0
policy = self.package._pcache._depcache.policy
for (packagefile, _unused) in self._cand.file_list:
priority = max(priority, policy.get_priority(packagefile))
return priority
return self.package._pcache._depcache.policy.get_priority(self._cand)
@property
def record(self):
......
......@@ -12,6 +12,10 @@ Changed
objects in addition to :class:`apt_pkg.Package` and :class:`apt_pkg.PackageFile`
ones.
* :attr:`apt.package.Version.policy_priority` now returns the priority
for that version rather than the highest priority for one of its
package files.
Added
------
* The class :class:`apt_pkg.PackageRecords` can now lookup custom fields
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment