]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use apt-ftparchive instead of reprepro main
authorThomas Mühlbacher <tmuehlbacher@posteo.net>
Sat, 9 Aug 2025 22:50:42 +0000 (00:50 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 13 Aug 2025 15:53:36 +0000 (17:53 +0200)
Afaict, this should work quite similar to the previous dpkg-scanpackages but
also doesn't use perl and is part of apt. Certain distros don't have reprepro
packaged, e.g. nixpkgs. It's also a simpler to work with and smaller compared
to reprepro.

mkosi/installer/apt.py
mkosi/resources/man/mkosi.1.md
mkosi/resources/mkosi-tools/mkosi.conf.d/debian-kali-ubuntu/mkosi.conf
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/arch.conf
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/fedora.conf
mkosi/resources/mkosi-tools/mkosi.profiles/package-manager/mkosi.conf.d/opensuse.conf

index cefa13cc0cfb439b28cdea0728ea81361ba80d6e..6b6842ebc5f4ef7253853d768018710579a586eb 100644 (file)
@@ -280,38 +280,17 @@ class Apt(PackageManager):
         if not names:
             return
 
-        if not (conf := context.repository / "conf/distributions").exists():
-            conf.parent.mkdir(exist_ok=True)
-            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(
-            [
-                "reprepro",
-                "--ignore=extension",
-                "includedeb",
-                "mkosi",
-                *names,
-            ],
-            sandbox=context.sandbox(
-                options=[
-                    "--bind", context.repository, workdir(context.repository),
-                    "--chdir", workdir(context.repository),
-                ],
-            ),
-        )  # fmt: skip
+        with (context.repository / "Packages").open("wb") as f:
+            run(
+                ["apt-ftparchive", "packages", "."],
+                stdout=f,
+                sandbox=context.sandbox(
+                    options=[
+                        "--ro-bind", context.repository, workdir(context.repository),
+                        "--chdir", workdir(context.repository),
+                    ],
+                ),
+            )  # fmt: skip
 
         (context.sandbox_tree / "etc/apt/sources.list.d").mkdir(parents=True, exist_ok=True)
         (context.sandbox_tree / "etc/apt/sources.list.d/mkosi-local.sources").write_text(
@@ -320,8 +299,7 @@ class Apt(PackageManager):
                 Enabled: yes
                 Types: deb
                 URIs: file:///repository
-                Suites: mkosi
-                Components: main
+                Suites: ./
                 Trusted: yes
                 """
             )
index 7e057ff6d9ef84327af0cc6f585805a79f92879a..f1772b179c7d7e65982ad770c47b5980ca77ded9 100644 (file)
@@ -772,10 +772,6 @@ 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=`
index bccef070fb5d16ed9bc023eaca599cfa55dc641a..b21ec26b1510a2638a60cbb790acd06c58aea84c 100644 (file)
@@ -9,6 +9,7 @@ Distribution=|ubuntu
 Packages=
         ?exact-name(grub-pc-bin)
         apt
+        apt-utils
         btrfs-progs
         erofs-utils
         grub-common
@@ -17,6 +18,5 @@ Packages=
         libtss2-dev
         policycoreutils
         python3-pefile
-        reprepro
         squashfs-tools
         xz-utils
index c69ece0ade9d14587077d77dccc904d1692a34c7..024ea71e18318098c350ef6fd6a3a2cfa09f17b9 100644 (file)
@@ -10,6 +10,5 @@ Packages=
         createrepo_c
         distribution-gpg-keys
         dnf5
-        reprepro
         ubuntu-keyring
         zypper
index 7e6e10db4e0e5b1603c846ef0950ba7f7cc91283..f7af1af7049c403073703945a90325f2a2a71614 100644 (file)
@@ -6,9 +6,9 @@ Distribution=fedora
 [Content]
 Packages=
         apt
+        apt-utils
         archlinux-keyring
         debian-keyring
         pacman
-        reprepro
         ubu-keyring
         zypper
index 3f876c9ffa92d4a66cd54db4b7c6949b387c7417..47df9a5d10af25da6555b40e6acc45f0f24e3ac2 100644 (file)
@@ -7,4 +7,3 @@ Distribution=opensuse
 Packages=
         dnf5
         dnf5-plugins
-        reprepro