BuildRoot: Support adding custom env vars
We will need this later to set SOURCE_DATE_EPOCH in the build.
This commit is contained in:
parent
31fb124716
commit
e516bf7898
1 changed files with 3 additions and 1 deletions
|
|
@ -169,7 +169,7 @@ class BuildRoot(contextlib.AbstractContextManager):
|
|||
if self._exitstack:
|
||||
self._exitstack.enter_context(api)
|
||||
|
||||
def run(self, argv, monitor, timeout=None, binds=None, readonly_binds=None):
|
||||
def run(self, argv, monitor, timeout=None, binds=None, readonly_binds=None, extra_env=None):
|
||||
"""Runs a command in the buildroot.
|
||||
|
||||
Takes the command and arguments, as well as bind mounts to mirror
|
||||
|
|
@ -282,6 +282,8 @@ class BuildRoot(contextlib.AbstractContextManager):
|
|||
"PYTHONUNBUFFERED": "1",
|
||||
"TERM": os.getenv("TERM", "dumb"),
|
||||
}
|
||||
if extra_env:
|
||||
env.update(extra_env)
|
||||
|
||||
proc = subprocess.Popen(cmd,
|
||||
bufsize=0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue