From: Daan De Meyer Date: Fri, 13 Dec 2024 11:58:16 +0000 (+0100) Subject: pacman: Make sure repositories from dropins take priority X-Git-Tag: v25~114^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3275%2Fhead;p=thirdparty%2Fmkosi.git 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. --- 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 @@ class Pacman(PackageManager): # 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} """ ) )