]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
apt: support including additional configuration for reprepro
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 27 May 2025 09:41:50 +0000 (11:41 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 27 May 2025 15:38:21 +0000 (17:38 +0200)
mkosi/installer/apt.py
mkosi/resources/man/mkosi.1.md

index 1d78f22c532a8a477a1f87b856cf144419d88647..cefa13cc0cfb439b28cdea0728ea81361ba80d6e 100644 (file)
@@ -282,18 +282,20 @@ class Apt(PackageManager):
 
         if not (conf := context.repository / "conf/distributions").exists():
             conf.parent.mkdir(exist_ok=True)
-            conf.write_text(
-                textwrap.dedent(
-                    f"""\
-                    Origin: mkosi
-                    Label: mkosi
-                    Architectures: {context.config.distribution.architecture(context.config.architecture)}
-                    Codename: mkosi
-                    Components: main
-                    Description: mkosi local repository
-                    """
-                )
+            distconfig = textwrap.dedent(
+                f"""\
+                Origin: mkosi
+                Label: mkosi
+                Architectures: {context.config.distribution.architecture(context.config.architecture)}
+                Codename: mkosi
+                Components: main
+                Description: mkosi local repository
+                """
             )
+            for distconfinclude in ("usr/lib/reprepro/", "etc/reprepro/"):
+                if (context.sandbox_tree / distconfinclude).exists():
+                    distconfig += f"!include: /{distconfinclude}\n"
+            conf.write_text(distconfig)
 
         run(
             [
index 429c9c9e018fb1aa0d720125e3acbd82d7050e6a..1b3810e3a76b52dc24a913c9ec44daff039fb46c 100644 (file)
@@ -772,6 +772,10 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
     running scripts. If the `mkosi.packages/` directory is found in the local
     directory it is also used for this purpose.
 
+    On deb-based distributions the local repository will be created with **reprepro** and additional
+    configuration for reprepro will be included from `/usr/lib/reprepro` and `/etc/reprepro` in the sandbox
+    trees, see **reprepro(1)** for details on reprepro configuration includes.
+
 `VolatilePackageDirectories=`, `--volatile-package-directory=`
 :   Like `PackageDirectories=`, but any changes to the packages in these
     directories will not invalidate the cached images if `Incremental=`