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.
# 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}
"""
)
)