Bug 1934883

Summary: [RFE] dnf: swap more than two packages in one transaction
Product: [Fedora] Fedora Reporter: Carl George 🤠 <carl>
Component: dnfAssignee: rpm-software-management
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: rawhideCC: dmach, jmracek, jrohel, mblaha, mhatina, ngompa13, packaging-team-maint, peter, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-09 20:11:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1665453    

Description Carl George 🤠 2021-03-03 22:49:47 UTC
Description of problem:
`yum swap` allowed swapping more than two packages using `--` as a delimiter between the packages to remove and the packages to install.  This no longer works with `dnf swap`.


Version-Release number of selected component (if applicable):
dnf-4.6.0-1.fc34.noarch


How reproducible:
always


Steps to Reproduce:
(the exact packages don't matter, these were picked at random)
1. dnf install color-filesystem emacs-filesystem
2. dnf swap -- color-filesystem emacs-filesystem -- kde-filesystem mesa-filesystem


Actual results:
dnf swap: error: unrecognized arguments: kde-filesystem mesa-filesystem


Expected results:
Uninstall of color-filesystem and emacs-filesystem, install of kde-filesystem and mesa-filesystem.


Additional info:
`dnf shell` can also be used to accomplish this task, but that requires interactive input, a separate file, or shell redirection.  `dnf swap` is an easy and convenient way to perform transactions like this in a single command non-interactively.  It is especially useful when building container images.

Comment 1 Neal Gompa 2021-03-03 23:00:34 UTC
This is similar to bug 1403465, though this one talks about restoring functionality that YUM previously had, and that bug talked about adding *new* syntax to support this.

Comment 2 Jaroslav Mracek 2023-08-09 20:11:02 UTC
I suggest that package swap is required when packages conflicts - what about to use `dnf install <args> --allowerasing`. This was the original replacement of swap and shell ind dnf. Due to presence of workarounds I am closing the issue.

Comment 3 Carl George 🤠 2023-08-09 23:53:48 UTC
`dnf install <args> --allowerasing` is great when conflicts exist in the packages.  It doesn't help when you need to swap sets of multiple packages which do not conflict, which yum allowed you to do.  I understand if the final answer is WONTFIX, but it's still a regression.

Is that WONTFIX decision for dnf4 and dnf5, or dnf4 only?