Skip to content

Conversation

jeff350
Copy link

@jeff350 jeff350 commented Jul 2, 2025

What does this PR do?

uses dnf check-update to list packages with available updates vs dnf list --upgrades to ensure held packages are not listed as available upgrades

What issues does this PR fix or reference?

fixes #68138

Previous Behavior

The previous behavior used dnf list --upgrades which would show versionlocked or held packages to be shown as having upgrades available

New Behavior

uses dnf check-update which takes version locking into account

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, would you mind writing a test for this? Also needs a changelog

@twangboy twangboy added test:full Run the full test suite needs-changelog needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases labels Jul 3, 2025
@twangboy twangboy added this to the Argon v3008.0 milestone Jul 3, 2025
@@ -1037,7 +1037,7 @@ def list_upgrades(refresh=True, **kwargs):

cmd = ["--quiet"]
cmd.extend(options)
cmd.extend(["list", "--upgrades" if _yum() in ("dnf", "dnf5") else "updates"])
cmd.extend(["check-update"] if _yum() in ("dnf", "dnf5") else ["list", "updates"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output of check-update is not just a drop in replacement for list --upgrades. check-update also includes an Obsoleting Packages section at the bottom that includes the currently installed package and the newer version package from the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-changelog needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] ensure consistent behavior in pkg.list_updates between Debian-based and RedHat-based systems for held packages
3 participants