eapi = self.get('EAPI')
phase = self.get('EBUILD_PHASE')
filter_calling_env = False
- if phase not in ('clean', 'cleanrm', 'depend'):
+ if phase not in ('clean', 'cleanrm', 'depend', 'fetch'):
temp_dir = self.get('T')
if temp_dir is not None and \
os.path.exists(os.path.join(temp_dir, 'environment')):
if args[0] != BASH_BINARY:
args = [BASH_BINARY, "-c", "exec \"$@\"", args[0]] + args
- rval = spawn_func(args, env=settings.environ(), **kwargs)
+ # Ensure that EBUILD_PHASE is set to fetch, so that config.environ()
+ # does not filter the calling environment (which may contain needed
+ # proxy variables, as in bug #315421).
+ phase_backup = settings.get('EBUILD_PHASE')
+ settings['EBUILD_PHASE'] = 'fetch'
+ try:
+ rval = spawn_func(args, env=settings.environ(), **kwargs)
+ finally:
+ if phase_backup is None:
+ settings.pop('EBUILD_PHASE', None)
+ else:
+ settings['EBUILD_PHASE'] = phase_backup
return rval