]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make apivfs argument of invoke() false by default
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 15 Feb 2024 09:48:26 +0000 (10:48 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 15 Feb 2024 18:57:56 +0000 (19:57 +0100)
Let's not implicitly mount an apivfs every time we mount a package
manager but make this opt-in instead.

mkosi/distributions/arch.py
mkosi/distributions/centos.py
mkosi/distributions/debian.py
mkosi/distributions/fedora.py
mkosi/distributions/opensuse.py
mkosi/installer/apt.py
mkosi/installer/dnf.py
mkosi/installer/pacman.py
mkosi/installer/zypper.py

index 0c45aa1c0414ce0af7395bc369e47ff24ee39282..4bca1f05fcf4e596481a082162c5465285ac9830 100644 (file)
@@ -64,7 +64,7 @@ class Installer(DistributionInstaller):
 
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
-        Pacman.invoke(context, "--remove", ["--nosave", "--recursive"], packages)
+        Pacman.invoke(context, "--remove", ["--nosave", "--recursive"], packages, apivfs=True)
 
     @classmethod
     @listify
index 62e5db76154ef2af13db1abf0878b64eb7ee6ab6..42dc762f7afa3f51bfb7135d77ee7f456262a667 100644 (file)
@@ -96,7 +96,7 @@ class Installer(DistributionInstaller):
 
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
-        Dnf.invoke(context, "remove", packages)
+        Dnf.invoke(context, "remove", packages, apivfs=True)
 
     @classmethod
     def architecture(cls, arch: Architecture) -> str:
index 1db94fd54c487521bbd51a5be077b44bba70c42a..db477c615f7f813be99f4b4012b9fec4e8814961 100644 (file)
@@ -157,7 +157,6 @@ class Installer(DistributionInstaller):
                     f"-oDPkg::Pre-Install-Pkgs::=cat >{f.name}",
                     "?essential", "?exact-name(usr-is-merged)",
                 ],
-                apivfs=False,
                 mounts=("--bind", f.name, f.name),
             )
 
@@ -216,7 +215,7 @@ class Installer(DistributionInstaller):
 
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
-        Apt.invoke(context, "purge", packages)
+        Apt.invoke(context, "purge", packages, apivfs=True)
 
     @classmethod
     def architecture(cls, arch: Architecture) -> str:
index 6bf1fe8b3a14f61c3e314225daae887bd2d232d5..cb45ef501bfa345fded5c50da621409aa6bb63ad 100644 (file)
@@ -69,7 +69,7 @@ class Installer(DistributionInstaller):
 
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
-        Dnf.invoke(context, "remove", packages)
+        Dnf.invoke(context, "remove", packages, apivfs=True)
 
     @classmethod
     @listify
index d46961c2da2f6288b1b1e1aaf95a4963e3eaba55..4e6a57189a960e3cf762d596b290ee16103c7330 100644 (file)
@@ -91,9 +91,9 @@ class Installer(DistributionInstaller):
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
         if find_binary("zypper", root=context.config.tools()):
-            Zypper.invoke(context, "remove", packages, options=["--clean-deps"])
+            Zypper.invoke(context, "remove", packages, options=["--clean-deps"], apivfs=True)
         else:
-            Dnf.invoke(context, "remove", packages)
+            Dnf.invoke(context, "remove", packages, apivfs=True)
 
     @classmethod
     @listify
index 9d78a1ef0b6ad89ead90e6f1d08c778fc771a5f6..e3f454a83279d619dfcf6db251efe5156e9b6575 100644 (file)
@@ -170,7 +170,7 @@ class Apt(PackageManager):
         packages: Sequence[str] = (),
         *,
         options: Sequence[str] = (),
-        apivfs: bool = True,
+        apivfs: bool = False,
         mounts: Sequence[PathString] = (),
     ) -> CompletedProcess:
         with finalize_ephemeral_source_mounts(context.config) as sources:
@@ -230,5 +230,4 @@ class Apt(PackageManager):
                 "-o", "Dir::Etc::sourceparts=-",
                 "-o", "APT::Get::List-Cleanup=0",
             ],
-            apivfs=False,
         )
index 0acff3dd14acc3ddd8afbe7eafa67ed542b22790..19b5cf8ea800b1be34e5b6f8ff0b76bc3377ffad 100644 (file)
@@ -157,7 +157,7 @@ class Dnf(PackageManager):
         operation: str,
         packages: Iterable[str] = (),
         options: Sequence[str] = (),
-        apivfs: bool = True,
+        apivfs: bool = False,
     ) -> CompletedProcess:
         try:
             with finalize_ephemeral_source_mounts(context.config) as sources:
@@ -194,7 +194,6 @@ class Dnf(PackageManager):
                 *(["--setopt=cacheonly=none"] if cls.executable(context.config) == "dnf5" else []),
                 *options,
             ],
-            apivfs=False,
         )
 
     @classmethod
index 6fe0d1cce2623bddf596f821f0dc3c423e751c26..c35d57b1163a4e201030b8ade066a952b0ff3e54 100644 (file)
@@ -147,7 +147,7 @@ class Pacman(PackageManager):
         operation: str,
         options: Sequence[str] = (),
         packages: Sequence[str] = (),
-        apivfs: bool = True,
+        apivfs: bool = False,
     ) -> CompletedProcess:
         with finalize_ephemeral_source_mounts(context.config) as sources:
             return run(
@@ -168,7 +168,7 @@ class Pacman(PackageManager):
 
     @classmethod
     def sync(cls, context: Context) -> None:
-        cls.invoke(context, "--sync", ["--refresh"], apivfs=False)
+        cls.invoke(context, "--sync", ["--refresh"])
 
     @classmethod
     def createrepo(cls, context: Context) -> None:
index afedee5a1678716b1345c7e56bbbfdc0f37f3516..1f8f2e8df7615eb6afa73293d73330245593c1f3 100644 (file)
@@ -118,7 +118,7 @@ class Zypper(PackageManager):
         packages: Sequence[str] = (),
         *,
         options: Sequence[str] = (),
-        apivfs: bool = True,
+        apivfs: bool = False,
     ) -> CompletedProcess:
         with finalize_ephemeral_source_mounts(context.config) as sources:
             return run(
@@ -139,7 +139,7 @@ class Zypper(PackageManager):
 
     @classmethod
     def sync(cls, context: Context) -> None:
-        cls.invoke(context, "refresh", apivfs=False)
+        cls.invoke(context, "refresh")
 
     @classmethod
     def createrepo(cls, context: Context) -> None:
@@ -160,4 +160,4 @@ class Zypper(PackageManager):
             )
         )
 
-        cls.invoke(context, "refresh", ["mkosi"], apivfs=False)
+        cls.invoke(context, "refresh", ["mkosi"])