diff --git a/pisi/actionsapi/variables.py b/pisi/actionsapi/variables.py index ebc6dfc0..48556714 100644 --- a/pisi/actionsapi/variables.py +++ b/pisi/actionsapi/variables.py @@ -13,6 +13,7 @@ # Standard Python Modules from os import getenv from os import environ +from copy import deepcopy # Pisi-Core Modules import pisi.context as ctx @@ -22,6 +23,10 @@ import pisi.context as ctx def exportFlags(): '''General flags used in actions API.''' + # first reset environ + environ = {} + environ = deepcopy(ctx.config.environ) + # Build systems depend on these environment variables. That is why # we export them instead of using as (instance) variables. values = ctx.config.values @@ -31,6 +36,7 @@ def exportFlags(): environ['LDFLAGS'] = values.build.ldflags environ['USER_LDFLAGS'] = values.build.ldflags environ['JOBS'] = values.build.jobs + class Env(object): '''General environment variables used in actions API''' diff --git a/pisi/config.py b/pisi/config.py index 650534b2..2962d910 100644 --- a/pisi/config.py +++ b/pisi/config.py @@ -18,6 +18,7 @@ regular PISI configurations. """ import os +from copy import deepcopy import gettext __trans = gettext.translation('pisi', fallback=True) @@ -59,6 +60,10 @@ class Config(object): ctx.ui.warning( _('Destination directory %s does not exist. Creating it.') % self.destdir) os.makedirs(self.destdir) + # get the initial environment variables. this is needed for + # build process. + self.environ = deepcopy(os.environ) + def get_option(self, opt): if self.options: