]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Skip createrepo() for apt if there are no debs
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 28 Feb 2025 10:49:41 +0000 (11:49 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 28 Feb 2025 12:14:48 +0000 (13:14 +0100)
reprepro fails if there are no packages passed to it so skip it if
there are no packages.

mkosi/installer/apt.py

index 5a1e153ff4aa2143d4db66dca128f85bea38dbea..2b9a4a33c07e6fc22bbeb499c4f1021e2bc17602 100644 (file)
@@ -235,6 +235,10 @@ class Apt(PackageManager):
 
     @classmethod
     def createrepo(cls, context: Context) -> None:
+        names = [d.name for glob in PACKAGE_GLOBS for d in context.repository.glob(glob) if "deb" in glob]
+        if not names:
+            return
+
         if not (conf := context.repository / "conf/distributions").exists():
             conf.parent.mkdir(exist_ok=True)
             conf.write_text(
@@ -256,7 +260,7 @@ class Apt(PackageManager):
                 "--ignore=extension",
                 "includedeb",
                 "mkosi",
-                *(d.name for glob in PACKAGE_GLOBS for d in context.repository.glob(glob) if "deb" in glob),
+                *names,
             ],
             sandbox=context.sandbox(
                 options=[