]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Be more conservative in what we copy from package directories
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 6 May 2024 15:11:21 +0000 (17:11 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 7 May 2024 08:20:22 +0000 (10:20 +0200)
Let's make sure we only copy packages from package directories so
that PackageDirectories= can be pointed at a directory containing
more than just packages without copying everything.

mkosi/__init__.py

index 87fe3357f12ca28e491878b49b2c10ef36270b63..94993843718ae8d8a1c77890806ec6fb0e8eb751 100644 (file)
@@ -1609,11 +1609,14 @@ def install_package_directories(context: Context) -> None:
 
     with complete_step("Copying in extra packages…"):
         for d in context.config.package_directories:
-            copy_tree(
-                d, context.packages,
-                use_subvolumes=context.config.use_subvolumes,
-                sandbox=context.sandbox,
-            )
+            for p in itertools.chain(
+                d.glob("*.rpm*"),
+                d.glob("*.pkg.tar*"),
+                d.glob("*.deb*"),
+                d.glob("*.ddeb*"),
+                d.glob("*.udeb*"),
+            ):
+                shutil.copy(p, context.packages, follow_symlinks=True)
 
     if context.want_local_repo():
         with complete_step("Building local package repository"):