rawpkeywords = [grabdict_package(
os.path.join(x, "package.keywords"), recursive=1) \
for x in self.profiles]
- for i in xrange(len(self.profiles)):
+ for pkeyworddict in rawpkeywords:
cpdict = {}
- for k, v in rawpkeywords[i].iteritems():
+ for k, v in pkeyworddict.iteritems():
cpdict.setdefault(dep_getkey(k), {})[k] = v
self._pkeywords_list.append(cpdict)
mydict={}
environ_filter = self._environ_filter
+ phase = self.get('EBUILD_PHASE')
filter_calling_env = False
- temp_dir = self.get("T")
- if temp_dir is not None and \
- os.path.exists(os.path.join(temp_dir, "environment")):
- filter_calling_env = True
+ if phase not in ('clean', 'cleanrm', 'depend'):
+ temp_dir = self.get('T')
+ if temp_dir is not None and \
+ os.path.exists(os.path.join(temp_dir, 'environment')):
+ filter_calling_env = True
environ_whitelist = self._environ_whitelist
env_d = self.configdict["env.d"]
mydict["HOME"]=mydict["BUILD_PREFIX"][:]
if filter_calling_env:
- phase = self.get("EBUILD_PHASE")
if phase:
whitelist = []
if "rpm" == phase:
if k not in internal_columns:
d[k] = result[0][column_index]
+ # As a temporary workaround for bug #263081, convert unicode strings
+ # to raw byte strings. This helps to potential unicode errors that can
+ # be triggered elsewhere when attempting to join unicode strings with
+ # raw byte strings. TODO: Convert all string handling code to use
+ # unicode strings instead of raw byte strings (required for py3k
+ # compatibility).
+ for k, v in d.iteritems():
+ try:
+ d[k] = str(v)
+ except UnicodeEncodeError:
+ pass
+
return d
def _setitem(self, cpv, values):
# If an absolute path to an executable file isn't given
# search for it unless we've been told not to.
binary = mycommand[0]
- if (not os.path.isabs(binary) or not os.path.isfile(binary)
+ if binary not in (BASH_BINARY, SANDBOX_BINARY, FAKEROOT_BINARY) and \
+ (not os.path.isabs(binary) or not os.path.isfile(binary)
or not os.access(binary, os.X_OK)):
binary = path_lookup and find_binary(binary) or None
if not binary: