summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2015-06-10 22:55:23 +0200
committerJulian Andres Klode <jak@debian.org>2015-06-10 22:55:23 +0200
commit1c99fa6d8e17d331a2f11ccf7061815cba03cb12 (patch)
tree907fd6c649250f361fc46978d41d60fd7fec6113 /apt
parentee088583a3b4a0843c36b3eee75879ad93d5e5c8 (diff)
downloadpython-apt-1c99fa6d8e17d331a2f11ccf7061815cba03cb12.tar.gz
apt/debfile.py: Allow downgrading packages in check() with a parameter
Well, we do not want to allow that in general. Closes: #613974
Diffstat (limited to 'apt')
-rw-r--r--apt/debfile.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index b116a1aa..e9be9672 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -481,7 +481,7 @@ class DebPackage(object):
return self.VERSION_OUTDATED
return self.VERSION_NONE
- def check(self):
+ def check(self, allow_downgrade=False):
"""Check if the package is installable."""
self._dbg(3, "check")
@@ -504,7 +504,8 @@ class DebPackage(object):
return False
# check version
- if self.compare_to_version_in_cache() == self.VERSION_OUTDATED:
+ if (not allow_downgrade and
+ self.compare_to_version_in_cache() == self.VERSION_OUTDATED):
if self._cache[self.pkgname].installed:
# the deb is older than the installed
self._failure_string = _(