Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove --duplicates and --oldinstallonly exit with 0 when nothing to remove (RHEL-6424) #2076

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dnf/cli/commands/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def run(self):
instonly = self.base._get_installonly_query(q.installed())
dups = q.duplicated().difference(instonly)
if not dups:
raise dnf.exceptions.Error(_('No duplicated packages found for removal.'))
logger.info(_('No duplicated packages found for removal.'))
return

for (name, arch), pkgs_list in dups._na_dict().items():
if len(pkgs_list) < 2:
Expand Down Expand Up @@ -123,8 +124,7 @@ def run(self):
for pkg in instonly:
self.base.package_remove(pkg)
else:
raise dnf.exceptions.Error(
_('No old installonly packages found for removal.'))
logger.info(_('No old installonly packages found for removal.'))
return

# Remove groups.
Expand Down
Loading