]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
apt: Add higher priority for mkosi local repository
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 5 Mar 2025 19:11:58 +0000 (20:11 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 6 Mar 2025 10:08:39 +0000 (11:08 +0100)
Apt actually supports priorities as well, so add a high priority like
we do for the other package managers as well for the local mkosi repository.

mkosi/installer/apt.py

index 2b9a4a33c07e6fc22bbeb499c4f1021e2bc17602..ec89a4d82951ec3955f3b064480bd6dc0982e939 100644 (file)
@@ -284,6 +284,17 @@ class Apt(PackageManager):
             )
         )
 
+        (context.sandbox_tree / "etc/apt/preferences.d").mkdir(parents=True, exist_ok=True)
+        (context.sandbox_tree / "etc/apt/preferences.d/mkosi-local.pref").write_text(
+            textwrap.dedent(
+                """\
+                Package: *
+                Pin: origin mkosi
+                Pin-Priority: 1100
+                """
+            )
+        )
+
         cls.invoke(
             context,
             "update",