makechrootpkg: Fix conflict handling
This MR solves #163 (closed) and provides a logically sound solution addressing the concerns in b7893a2c
pacinstall
is an alternative to pacman and provides options for non-interactive package handling.
Alternatives using pacman
(e.g. the --ask=4
option) suffer from the intentional obscurity of automation while usually looking cleaner.
In particular, the option --resolve-conflicts=all
removes the installed conflicting packages and replaces them with the new packages.
pacutils
needs to be installed for pacinstall to be available. Since pacutils isn't in base-devel
, it is installed on demand and uninstalled afterwards.
If it was indeed supposed to be installed, then the pacman command after it will do so, since all conflicts have been resolved.
Having pacutils
installed as a requirement (in addition to, but separate from base-devel
) would clean up the internal logic, but increases complexity on the user end as users must not expect it to be installed (though must not fail if it is).
If pacutils
is already installed, then just do the conflict resolution.
This is quite the workaround in order to be able to use pacutils
- at least it actually solves the issue as I understand it.
Feedback is welcome!
Update: I'm working on getting pacutils
into base-devel
to make this MR cleaner: archlinux/packaging/packages/base-devel#3
Update: There is #226 (closed) to see which approach (pacutils
or pacman --ask=4
) is favored by the devs of devtools
.
Closes #163 (closed)
Based on this thread: pacman/pacman#60 (comment 131527)