]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
debian: only write sources.list during setup if one isn't in the package manager...
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 7 Jun 2023 13:02:48 +0000 (15:02 +0200)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 8 Jun 2023 14:45:42 +0000 (16:45 +0200)
mkosi/distributions/debian.py

index 15c8c6bdd47dc496cb8055498433fe6bc8217574..ac5c55c9431905f0af7797e771d1b7a556d071de 100644 (file)
@@ -208,9 +208,11 @@ def setup_apt(state: MkosiState, repos: Sequence[str]) -> None:
         )
     )
 
-    with state.workspace.joinpath("pkgmngr/etc/apt/sources.list").open("w") as f:
-        for repo in repos:
-            f.write(f"{repo}\n")
+    sources = state.pkgmngr.joinpath("etc/apt/sources.list")
+    if not sources.exists():
+        with sources.open("w") as f:
+            for repo in repos:
+                f.write(f"{repo}\n")
 
 
 def invoke_apt(