Allow specifying environment variables independently

This commit adds changes to allow specifying enviornment variables independently for each package. This is helpful to avoid influence of one env variable meant for a specific package on another which might result in changed behavior when it builds.
This commit is contained in:
Waqar Ahmed
2021-06-06 18:27:51 +05:00
parent 7cf19855f4
commit b3ad84f58a
3 changed files with 7 additions and 4 deletions

View File

@@ -19,8 +19,7 @@ class BuildPackageMixin:
env={
**os.environ,
**APT_ENV,
'CONFIG_DEBUG_INFO': 'Y', # Build kernel with debug symbols
'CONFIG_LOCALVERSION': '+truenas',
**self.env,
}
)
@@ -71,7 +70,7 @@ class BuildPackageMixin:
predep_cmd = predep_entry['command']
skip_cmd = False
for env_var in predep_entry['env_checks']:
if os.environ.get(env_var['key']) != env_var['value']:
if all(f(env_var['key']) != env_var['value'] for f in (os.environ.get, self.env.get)):
self.logger.debug(
'Skipping %r predep command because %r does not match %r',
predep_cmd, env_var['key'], env_var['value']