Skip to content

Commit

Permalink
remove --duplicates: when no duplicates, exit with 0 (RHEL-6424)
Browse files Browse the repository at this point in the history
If no duplicates are present, then the command succesfully removed all
duplicates and should exit with 0 and write the message to stdout
instead of stderr.

Resolves: https://issues.redhat.com/browse/RHEL-6424
  • Loading branch information
pkratoch authored and m-blaha committed Apr 8, 2024
1 parent caa17e3 commit 720338f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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

0 comments on commit 720338f

Please sign in to comment.