Skip to content

Commit

Permalink
pacman: Make sure repositories from dropins take priority
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DaanDeMeyer committed Dec 13, 2024
1 parent 8343ba3 commit a32b809
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mkosi/installer/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""
)
)
Expand Down

0 comments on commit a32b809

Please sign in to comment.