From: Scott Worley Date: Wed, 19 Jan 2022 19:25:41 +0000 (-0800) Subject: Support restricted mode: Allow manifest access with search paths. X-Git-Tag: v3.0.6~1 X-Git-Url: http://git.scottworley.com/pinch/commitdiff_plain/3b2117a3ff0c74c8cf3dc27bbe9a3105428d03d5?ds=inline Support restricted mode: Allow manifest access with search paths. --- diff --git a/Changelog b/Changelog index de62e83..a0932a9 100644 --- a/Changelog +++ b/Changelog @@ -3,7 +3,7 @@ - Deprecate pinch. - Show the channel URL being fetched. - Use nix 2.3 because 2.4 broke . -- Support restricted mode: Allow tarball access with search paths. +- Support restricted mode: Allow tarball and manifest access with search paths. - Announce test names as they are run. diff --git a/pinch.py b/pinch.py index 2ba47b2..f95323f 100644 --- a/pinch.py +++ b/pinch.py @@ -644,7 +644,11 @@ def pinCommand(args: argparse.Namespace) -> None: def updateCommand(args: argparse.Namespace) -> None: v = Verification() exprs: Dict[str, str] = {} - search_paths: List[str] = [] + profile_manifest = os.path.join(args.profile, "manifest.nix") + search_paths: List[str] = [ + "-I", "pinch_profile=" + args.profile, + "-I", "pinch_profile_manifest=" + os.readlink(profile_manifest) + ] if os.path.exists(profile_manifest) else [] config = { section: read_pinned_config_section(section, conf) for section, conf in read_config_files(