#788387 gdebi: please allow package downgrade

Package:
gdebi
Source:
gdebi
Submitter:
Tshepang Lekhonkhobe
Date:
2021-09-26 12:45:03 UTC
Severity:
wishlist
#788387#5
Date:
2011-02-18 16:03:15 UTC
From:
To:
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.

#788387#16
Date:
2015-06-10 20:59:19 UTC
From:
To:
Control: tag -1 pending
Control: clone -1 -2
Control: reassign -2 gdebi

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 = _(

#788387#27
Date:
2017-03-30 20:54:30 UTC
From:
To:
gdebi 0.9.5.3ubuntu2 still cannot downgrade packages.  Only the underlying library was fixed, and even that fix has not shown up as of python-apt  0.9.3.5ubuntu2.



Please reopen.  I have verified that the fix works, once enabled in gdebi.



This is a blocker, unless someone can explain how to force a fixed apt version configuration, given lack of preservation of older versions in Ubuntu package archives, without hosting a complete, permanent mirror.

#788387#32
Date:
2017-04-12 06:04:32 UTC
From:
To:
gdebi 0.9.5.3ubuntu2 still cannot downgrade packages.  Only the underlying library was fixed, and even that fix has not shown up as of python-apt  0.9.3.5ubuntu2.

Please reopen.  I have verified that the fix in the ticket works (once it's enabled with a  gdebi option).

This is a blocker, unless someone can explain how to force a fixed apt version configuration, given lack of preservation of older versions in Ubuntu package archives, without hosting a complete, permanent mirror.

#788387#39
Date:
2021-09-26 12:43:55 UTC
From:
To:
Hi,

any chance to make gdebi allow downgrade (with some command line option),
it looks like almost all pieces are in place, just need command line
option in gdebi itself.


Regards,
Witold