From: Lucas De Marchi Date: Mon, 12 Nov 2018 18:58:27 +0000 (-0800) Subject: Make chown of output files optional X-Git-Tag: v5~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F284%2Fhead;p=thirdparty%2Fmkosi.git Make chown of output files optional --- diff --git a/mkosi b/mkosi index 87c2676ba..6dffd587b 100755 --- a/mkosi +++ b/mkosi @@ -2430,6 +2430,8 @@ def save_cache(args: CommandLineArguments, workspace: str, raw: str, cache_path: def _link_output(args: CommandLineArguments, oldpath: str, newpath: str): os.chmod(oldpath, 0o666 & ~args.original_umask) os.link(oldpath, newpath) + if args.no_chown: + return sudo_uid = os.getenv("SUDO_UID") sudo_gid = os.getenv("SUDO_GID") @@ -2635,6 +2637,7 @@ def parse_args() -> CommandLineArguments: group.add_argument('--debug', action=CommaDelimitedListAction, default=[], help='Turn on debugging output', metavar='SELECTOR', choices=('run',)) + group.add_argument('--no-chown', action='store_true', help='When running with sudo, disable reassignment of ownership of the generated files to the original user') try: argcomplete.autocomplete(parser)