From 581ded94677957b0e13e615e08104d54cef01fca Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 2 Jul 2024 13:05:44 +0200 Subject: [PATCH] base/stagebase.py: Add a mean to add additional env vars directly from the spec files --- catalyst/base/stagebase.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2dcf6d71..a2c26316 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -70,6 +70,7 @@ def __init__(self, myspec, addlargs): "compression_mode", "cxxflags", "decompressor_search_order", + "env", "fcflags", "fflags", "hostuse", @@ -1097,6 +1098,10 @@ def chroot_setup(self): shutil.copy(self.settings['envscript'], self.settings['chroot_path'] + '/tmp/envscript') + if "env" in self.settings: + with open(self.settings['chroot_path'] + '/tmp/envscript', "a+") as myf: + myf.write("export %s" % self.settings["env"]) + # Copy over /etc/hosts from the host in case there are any # specialties in there hosts_file = self.settings['chroot_path'] + '/etc/hosts'