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)
Merge request reports
Activity
mentioned in issue #163 (closed)
- Resolved by Vekhir --
Some comments:
- According to the manpage,
pacinstall
should be invoked with a closed stdin (<&-
) to account for cases where stdin is neither closed nor a tty. - I would use a single
arch-nspawn
command with abash -e -c '...' install-extra-packages "${pkgnames[@]/#//root/}"
instead. Within the-c
, use"$@"
for the list of package files. - I would not suppress stdout just because the proceedings look ugly. Particularly when there are still outputs to stderr (usually harmless, but confusing without the stdout context).
- What about the other available
--resolve*
options ofpacinstall
?
- According to the manpage,
added 62 commits
-
08d9c8fd...c79a9931 - 61 commits from branch
archlinux:master
- 19d72605 - makechrootpkg: Fix conflict handling
-
08d9c8fd...c79a9931 - 61 commits from branch
mentioned in issue #226 (closed)
added 11 commits
-
19d72605...05bea3e9 - 10 commits from branch
archlinux:master
- 08f8c2fe - fix(makechrootpkg): Conflict handling and packages with multiple providers
-
19d72605...05bea3e9 - 10 commits from branch
added statuson-hold label
I guess this was mostly superseeded by !245 (merged)
I'm closing this as the original issue for which this was a demonstration has been fixed. The question of utilizing
pacutils
(#226 (closed)) still stands, so this MR will remain a reference for that.Thanks to everyone who supported and upvoted this MR.