From: Daan De Meyer Date: Sun, 6 Aug 2023 17:51:37 +0000 (+0200) Subject: Resolve symlinks in config paths by default X-Git-Tag: v15~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd8b198aa5fdaeeb6b5fa4cb509fb831253c391;p=thirdparty%2Fmkosi.git Resolve symlinks in config paths by default --- diff --git a/mkosi/config.py b/mkosi/config.py index f0ea7aa8c..a3e525d0d 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -122,6 +122,7 @@ def parse_path(value: str, *, required: bool = True, absolute: bool = True, + resolve: bool = True, expanduser: bool = True, expandvars: bool = True, secret: bool = False) -> Path: @@ -141,6 +142,9 @@ def parse_path(value: str, if absolute: path = path.absolute() + if resolve: + path = path.resolve() + if secret and path.exists(): mode = path.stat().st_mode & 0o777 if mode & 0o007: @@ -426,6 +430,7 @@ def make_path_parser(*, def config_make_path_parser(*, required: bool = True, absolute: bool = True, + resolve: bool = True, expanduser: bool = True, expandvars: bool = True, secret: bool = False) -> ConfigParseCallback: @@ -438,6 +443,7 @@ def config_make_path_parser(*, value, required=required, absolute=absolute, + resolve=resolve, expanduser=expanduser, expandvars=expandvars, secret=secret,