summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 08:36:57 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 08:36:57 +0000
commit88797f923c6d2eee3e638316ce14964d6c75c75c (patch)
treedcce2649375d82424a4ad915ac76cbacfd48222d
parentFix error in calculations from bug #267104. (diff)
downloadportage-idfetch-88797f923c6d2eee3e638316ce14964d6c75c75c.tar.gz
portage-idfetch-88797f923c6d2eee3e638316ce14964d6c75c75c.tar.bz2
portage-idfetch-88797f923c6d2eee3e638316ce14964d6c75c75c.zip
Fix ACCEPT_LICENSE handling for binary packages, so that the build-time USE
settings are used calculate an appropriate ACCEPT_LICENSE value. svn path=/main/trunk/; revision=13560
-rwxr-xr-xbin/isolated-functions.sh2
-rw-r--r--pym/portage/__init__.py17
2 files changed, 13 insertions, 6 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index ccef19ed..0d046cbd 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -522,7 +522,7 @@ save_ebuild_env() {
${QA_INTERCEPTORS}
# portage config variables and variables set directly by portage
- unset BAD BRACKET BUILD_PREFIX COLS \
+ unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
EBUILD_EXIT_STATUS_FILE EBUILD_FORCE_TEST EBUILD_MASTER_PID \
ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY \
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index c121a0b9..1b927d51 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1061,7 +1061,7 @@ class config(object):
# environment in order to prevent sandbox from sourcing /etc/profile
# in it's bashrc (causing major leakage).
_environ_whitelist += [
- "BASH_ENV", "BUILD_PREFIX", "D",
+ "ACCEPT_LICENSE", "BASH_ENV", "BUILD_PREFIX", "D",
"DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD",
"EBUILD_EXIT_STATUS_FILE", "EBUILD_FORCE_TEST",
"EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM",
@@ -2080,18 +2080,22 @@ class config(object):
big (bigger than ARG_MAX), causing execve() calls to fail with E2BIG
errors as in bug #262647.
"""
- __slots__ = ('settings',)
+ __slots__ = ('built_use', 'settings',)
- def __init__(self, settings):
+ def __init__(self, built_use, settings):
+ self.built_use = built_use
self.settings = settings
def __call__(self):
settings = self.settings
+ use = self.built_use
+ if use is None:
+ use = settings['PORTAGE_USE']
try:
licenses = set(flatten(
dep.use_reduce(dep.paren_reduce(
settings['LICENSE']),
- uselist=settings['PORTAGE_USE'].split())))
+ uselist=use.split())))
except exception.InvalidDependString:
licenses = set()
if '*' not in settings._accept_license:
@@ -2196,11 +2200,14 @@ class config(object):
self.modifying()
pkg = None
+ built_use = None
if not isinstance(mycpv, basestring):
pkg = mycpv
mycpv = pkg.cpv
mydb = pkg.metadata
args_hash = (mycpv, id(pkg))
+ if pkg.built:
+ built_use = pkg.metadata['USE']
else:
args_hash = (mycpv, id(mydb))
@@ -2318,7 +2325,7 @@ class config(object):
env_configdict.pop(k, None)
env_configdict.addLazySingleton('ACCEPT_LICENSE',
- self._lazy_accept_license(self))
+ self._lazy_accept_license(built_use, self))
# If reset() has not been called, it's safe to return
# early if IUSE has not changed.