From: Daan De Meyer Date: Thu, 9 Feb 2023 21:51:23 +0000 (+0100) Subject: run: Use is_symlink() instead of exists() X-Git-Tag: v15~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be912b0fa4931403fddf649aa242cd4406471c4;p=thirdparty%2Fmkosi.git run: Use is_symlink() instead of exists() exists() will resolve the symlink in the host if it's absolute, let's use is_symlink() which checks if the symlink exists. --- diff --git a/mkosi/run.py b/mkosi/run.py index 200844336..61475c500 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -332,5 +332,5 @@ def run_workspace_command( run([*cmdline, template.format("sh")], check=False, env=env) die(f"\"{shlex.join(str(s) for s in cmd)}\" returned non-zero exit code {e.returncode}.") finally: - if state.workspace.joinpath("resolv.conf").exists(): + if state.workspace.joinpath("resolv.conf").is_symlink(): shutil.move(state.workspace.joinpath("resolv.conf"), resolve)