fix previous commit

This commit is contained in:
Barış Metin
2006-06-07 15:30:50 +00:00
parent 8e295cd6a6
commit ea04b18c0a
+10 -12
View File
@@ -11,8 +11,7 @@
# Please read the COPYING file. # Please read the COPYING file.
# Standard Python Modules # Standard Python Modules
from os import getenv import os
from os import environ
from copy import deepcopy from copy import deepcopy
# Pisi-Core Modules # Pisi-Core Modules
@@ -24,19 +23,18 @@ def exportFlags():
'''General flags used in actions API.''' '''General flags used in actions API.'''
# first reset environ # first reset environ
environ = {} os.environ = {}
environ = deepcopy(ctx.config.environ) os.environ = deepcopy(ctx.config.environ)
# Build systems depend on these environment variables. That is why # Build systems depend on these environment variables. That is why
# we export them instead of using as (instance) variables. # we export them instead of using as (instance) variables.
values = ctx.config.values values = ctx.config.values
environ['HOST'] = values.build.host os.environ['HOST'] = values.build.host
environ['CFLAGS'] = values.build.cflags os.environ['CFLAGS'] = values.build.cflags
environ['CXXFLAGS'] = values.build.cxxflags os.environ['CXXFLAGS'] = values.build.cxxflags
environ['LDFLAGS'] = values.build.ldflags os.environ['LDFLAGS'] = values.build.ldflags
environ['USER_LDFLAGS'] = values.build.ldflags os.environ['USER_LDFLAGS'] = values.build.ldflags
environ['JOBS'] = values.build.jobs os.environ['JOBS'] = values.build.jobs
class Env(object): class Env(object):
'''General environment variables used in actions API''' '''General environment variables used in actions API'''
@@ -63,7 +61,7 @@ class Env(object):
# Using environment variables is somewhat tricky. Each time # Using environment variables is somewhat tricky. Each time
# you need them you need to check for their value. # you need them you need to check for their value.
if self.__vars.has_key(attr): if self.__vars.has_key(attr):
return getenv(self.__vars[attr]) return os.getenv(self.__vars[attr])
else: else:
return None return None