Bug#613974: gdebi: please allow package downgrade
Control: tag -1 pending
Control: clone -1 -2
Control: reassign -2 gdebi
On Fri, Feb 18, 2011 at 04:03:15PM +0000, Tshepang Lekhonkhobe wrote:
> Package: gdebi
> Version: 0.6.4
> Severity: normal
>
> When trying to downgrade a package, I get a red warning indicating
> that. That is, since I'm already told of the risk, I should be given
> the chance to proceed. Please don't make me resort to dpkg/wajig for
> this.
Fixed in python-apt git. applications can now specify if they allow
downgrades or not. Still needs a fix in gdebi to use that argument.
>From 1c99fa6d8e17d331a2f11ccf7061815cba03cb12 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <jak@debian.org>
Date: Wed, 10 Jun 2015 22:55:23 +0200
Subject: [PATCH] apt/debfile.py: Allow downgrading packages in check() with a
parameter
Well, we do not want to allow that in general.
Closes: #613974
---
apt/debfile.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/apt/debfile.py b/apt/debfile.py
index b116a1a..e9be967 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 = _(
--
2.1.4
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Be friendly, do not top-post, and follow RFC 1855 "Netiquette".
- If you don't I might ignore you.
Reply to: