From: Daan De Meyer Date: Sun, 6 Aug 2023 18:39:01 +0000 (+0200) Subject: Don't resolve paths in two cases X-Git-Tag: v15~25^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ac564b095f3fe4229bb31f75aa6fe624c7e678e;p=thirdparty%2Fmkosi.git Don't resolve paths in two cases - Target paths should not be resolved - When checking paths for the paths logic, let's not resolve either and leave that to the parser implementation itself --- diff --git a/mkosi/config.py b/mkosi/config.py index a3e525d0d..344570473 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -161,7 +161,7 @@ def make_source_target_paths_parser(absolute: bool = True) -> Callable[[str], tu src, sep, target = value.partition(':') src_path = parse_path(src, required=False) if sep: - target_path = parse_path(target, required=False, absolute=False, expanduser=False) + target_path = parse_path(target, required=False, absolute=False, resolve=False, expanduser=False) if absolute and not target_path.is_absolute(): die("Target path must be absolute") else: @@ -1579,7 +1579,15 @@ class MkosiConfigParser: for s in self.SETTINGS: for f in s.paths: - p = parse_path(f, secret=s.path_secret, required=False, absolute=False, expanduser=False, expandvars=False) + p = parse_path( + f, + secret=s.path_secret, + required=False, + absolute=False, + resolve=False, + expanduser=False, + expandvars=False, + ) if p.exists(): setattr(namespace, s.dest, s.parse(s.dest, p.read_text() if s.path_read_text else f, namespace))