From: Joerg Behrmann Date: Wed, 7 Jun 2023 13:02:48 +0000 (+0200) Subject: debian: only write sources.list during setup if one isn't in the package manager... X-Git-Tag: v15~120^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35716ea6014681912e4049f137e2dc1f4bf347d2;p=thirdparty%2Fmkosi.git debian: only write sources.list during setup if one isn't in the package manager tree --- diff --git a/mkosi/distributions/debian.py b/mkosi/distributions/debian.py index 15c8c6bdd..ac5c55c94 100644 --- a/mkosi/distributions/debian.py +++ b/mkosi/distributions/debian.py @@ -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(