summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2008-12-06 12:43:35 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2008-12-06 12:43:35 +0000
commitfa2293e8576ee784fb8c86c504ae453ef22e4509 (patch)
treeb39d392594041b3c315a32454e111c0db3d143ed /lib
parent7c19c96919c55d848c594df7ef5cc21ac6a81b8c (diff)
downloadbitbake-fa2293e8576ee784fb8c86c504ae453ef22e4509.tar.gz
utils.py: Add empty_environment() function and call this from the cooker instead of hiding in data.py (from Poky)
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/cooker.py3
-rw-r--r--lib/bb/data.py2
-rw-r--r--lib/bb/utils.py7
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 58f67bda8..6a6d254d7 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -596,6 +596,9 @@ class BBCooker:
build.
"""
+ # Wipe the OS environment
+ bb.utils.empty_environment()
+
if self.configuration.show_environment:
self.showEnvironment(self.configuration.buildfile, self.configuration.pkgs_to_build)
sys.exit( 0 )
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 82eef4498..19e67dbc3 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -331,8 +331,6 @@ def inheritFromOS(d):
setVar(s, os.environ[s], d)
except TypeError:
pass
- os.unsetenv(s)
- del os.environ[s]
def emit_var(var, o=sys.__stdout__, d = init(), all=False):
"""Emit a variable to be sourced by a shell."""
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index aebeb3315..5015779f8 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -373,6 +373,13 @@ def clean_environment():
good_vars.extend(os.environ['BB_ENV_EXTRAWHITE'].split())
filter_environment(good_vars)
+def empty_environment():
+ """
+ Remove all variables from the environment.
+ """
+ for s in os.environ.keys():
+ os.unsetenv(s)
+ del os.environ[s]
def prunedir(topdir):
# Delete everything reachable from the directory named in 'topdir'.