From a32b8097e243ce1df68acc222f539d4be65a2449 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 13 Dec 2024 12:58:16 +0100 Subject: [PATCH] pacman: Make sure repositories from dropins take priority When multiple repositories ship the same package, the repository defined first in the pacman config file takes priority. Let's make sure user defined repositories take priority over the ones defined in mkosi by moving the Include= statement up a little in the config file. --- mkosi/installer/pacman.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mkosi/installer/pacman.py b/mkosi/installer/pacman.py index 3f120492f..e7db0a831 100644 --- a/mkosi/installer/pacman.py +++ b/mkosi/installer/pacman.py @@ -119,23 +119,23 @@ def setup(cls, context: Context, repositories: Sequence[PacmanRepository]) -> No # This has to go first so that our local repository always takes precedence over any other ones. f.write("Include = /etc/mkosi-local.conf\n") - for repo in repositories: + if any((context.sandbox_tree / "etc/pacman.d/").glob("*.conf")): f.write( textwrap.dedent( - f"""\ + """\ - [{repo.id}] - Server = {repo.url} + Include = /etc/pacman.d/*.conf """ ) ) - if any((context.sandbox_tree / "etc/pacman.d/").glob("*.conf")): + for repo in repositories: f.write( textwrap.dedent( - """\ + f"""\ - Include = /etc/pacman.d/*.conf + [{repo.id}] + Server = {repo.url} """ ) )