This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=97a7f65a22943e2efd56e589c64030eaff288233

commit 97a7f65a22943e2efd56e589c64030eaff288233
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Thu Oct 21 16:23:29 2021 +0200

    dpkg: Restore fallback to "new-prerm failed-upgrade" for downgrades
    
    This reverts commit 9d3ec0f5a727d439c3cbc8885bcbc78f7a34dd0b.
    
    The change does not make much sense, as there are cases where the old
    version does not need to have knowledge of the future problem to be able
    to recover, when just not having the problematic code might be enough
    for a correct installation.
    
    This also removes this unexpected special-case keyed on the version that
    is a completely anomalous compared with the rest of the maintscritpts
    handling.
    
    Analysis-by: Ian Jackson <ijack...@chiark.greenend.org.uk>
    Closes: #996959
---
 src/unpack.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/unpack.c b/src/unpack.c
index 2e0eb7b80..5c9fb4bc8 100644
--- a/src/unpack.c
+++ b/src/unpack.c
@@ -1293,17 +1293,8 @@ void process_archive(const char *filename) {
     pkg_set_status(pkg, PKG_STAT_HALFCONFIGURED);
     modstatdb_note(pkg);
     push_cleanup(cu_prermupgrade, ~ehflag_normaltidy, 1, (void *)pkg);
-    if (dpkg_version_compare(&pkg->available.version,
-                             &pkg->installed.version) >= 0)
-      /* Upgrade or reinstall. */
-      maintscript_fallback(pkg, PRERMFILE, "pre-removal", cidir, cidirrest,
-                           "upgrade", "failed-upgrade");
-    else /* Downgrade => no fallback */
-      maintscript_installed(pkg, PRERMFILE, "pre-removal",
-                            "upgrade",
-                            versiondescribe(&pkg->available.version,
-                                            vdew_nonambig),
-                            NULL);
+    maintscript_fallback(pkg, PRERMFILE, "pre-removal", cidir, cidirrest,
+                         "upgrade", "failed-upgrade");
     pkg_set_status(pkg, PKG_STAT_UNPACKED);
     oldversionstatus = PKG_STAT_UNPACKED;
     modstatdb_note(pkg);

-- 
Dpkg.Org's dpkg

Reply via email to