Skip to content

[BUG] History take-back obsoletes check is busted #195

@joebonrichie

Description

@joebonrichie

Description

Scenario:

You've updated and a package you previously had installed is now obsoleted
You takeback but the takeback fails and it attempts to install the obsoleted package

Version

4.3.4

Steps to reproduce

  • Install an obsoleted package
  • Update (the obsoleted package is removed)
  • Attempt to takeback to the previous transaction

Expected result

The takeback succeeds

Add any other information about this issue, such as tracebacks, screenshots, etc.

The check here fails:
https://github.com/getsolus/eopkg/blob/v4.3.4/pisi/operations/history.py#L61

A minimal patch allows the takeback to succeed

iff --git a/pisi/operations/history.py b/pisi/operations/history.py
index 01c596a..201c9bf 100644
--- a/pisi/operations/history.py
+++ b/pisi/operations/history.py
@@ -55,6 +55,7 @@ def __getpackageurl_binman(package):
     pkg, ver = pisi.util.parse_package_name(package)
 
     reponame = None
+    obsoleted = False
     try:
         reponame = packagedb.which_repo(pkg)
     except Exception:
@@ -62,6 +63,10 @@ def __getpackageurl_binman(package):
         for repo in repodb.get_binary_repos():
             if pkg in packagedb.get_obsoletes(repo):
                 reponame = repo
+                obsoleted = True
+
+    if obsoleted:
+        raise PackageNotFound
 
     if not reponame:
         raise PackageNotFound

I have not verified the patch in detail some more work is required to check to how it handles deps and why the original check is failing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions