From 04696e960745320dbec7b5b31713b5a280da3ad5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 14 Nov 2020 16:27:49 +0200 Subject: chore: update vendored copy of runcmd.py from Subplot We need a bug fix from there for passing in env to runcmd_run. --- subplot/runcmd.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subplot/runcmd.py b/subplot/runcmd.py index 532b60b..a2564c6 100644 --- a/subplot/runcmd.py +++ b/subplot/runcmd.py @@ -49,7 +49,16 @@ def runcmd_get_argv(ctx): # ctx context. def runcmd_run(ctx, argv, **kwargs): ns = ctx.declare("_runcmd") + + # The Subplot Python template empties os.environ at startup, modulo a small + # number of variables with carefully chosen values. Here, we don't need to + # care about what those variables are, but we do need to not overwrite + # them, so we just add anything in the env keyword argument, if any, to + # os.environ. env = dict(os.environ) + for key, arg in kwargs.pop("env", {}).items(): + env[key] = arg + pp = ns.get("path-prefix") if pp: env["PATH"] = pp + ":" + env["PATH"] -- cgit v1.2.1