fix: replace --ignore with --assume-installed=init-logind to bypass provider selection

--ignore doesn't reliably prevent pacman from considering elogind-dinit
during fresh provider resolution on all pacman versions. --assume-installed
creates a dummy installed package for init-logind, satisfying the
dependency from base without needing any provider at all. The explicitly
listed elogind-openrc then gets installed normally and provides
init-logind for real.

Dropped --ignore entirely in favor of --assume-installed + --ask=4
(conflict resolution safety net). --assume-installed only added for
non-dinit providers (openrc, runit, s6).
This commit is contained in:
2026-07-05 22:23:01 +02:00
parent 69da290ac5
commit 64b08a95ad
3 changed files with 23 additions and 33 deletions
@@ -343,22 +343,16 @@ class PMPacman(PackageManager):
# Don't report download progress for each file
command.append("--noprogressbar")
# Ignore init-logind providers that come alphabetically before
# the selected one, preventing pacman --noconfirm from picking
# the wrong one and pulling in a conflicting init system.
if libcalamares.globalstorage.contains("baseInit"):
base_init = libcalamares.globalstorage.value("baseInit")
# Pre-tend init-logind is already provided so pacman's resolver
# skips provider selection entirely, preventing it from selecting
# elogind-dinit (alphabetically before elogind-openrc) which would
# pull in dinit -> dinit-rc and conflict with OpenRC.
if libcalamares.globalstorage.contains("initProvider"):
provider = libcalamares.globalstorage.value("initProvider")
if base_init and provider:
sorted_inits = ["dinit", "openrc", "runit", "s6"]
if provider in sorted_inits:
idx = sorted_inits.index(provider)
for p in sorted_inits[:idx]:
ignore_pkg = f"{base_init}-{p}"
command.append(f"--ignore={ignore_pkg}")
if provider and provider != "dinit":
command.append("--assume-installed=init-logind")
# Safety net: auto-answer YES to conflict resolution (e.g.
# "remove dinit-rc?") if --ignore doesn't prevent the conflict.
# Safety net: auto-answer YES to conflict resolution
command.append("--ask=4")
if self.pacman_needed_only: