Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13560 - in main/trunk: bin pym/portage
Date: Thu, 30 Apr 2009 08:36:59
Message-Id: E1LzRlJ-0004PJ-P7@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-04-30 08:36:57 +0000 (Thu, 30 Apr 2009)
3 New Revision: 13560
4
5 Modified:
6 main/trunk/bin/isolated-functions.sh
7 main/trunk/pym/portage/__init__.py
8 Log:
9 Fix ACCEPT_LICENSE handling for binary packages, so that the build-time USE
10 settings are used calculate an appropriate ACCEPT_LICENSE value.
11
12
13 Modified: main/trunk/bin/isolated-functions.sh
14 ===================================================================
15 --- main/trunk/bin/isolated-functions.sh 2009-04-30 07:32:00 UTC (rev 13559)
16 +++ main/trunk/bin/isolated-functions.sh 2009-04-30 08:36:57 UTC (rev 13560)
17 @@ -522,7 +522,7 @@
18 ${QA_INTERCEPTORS}
19
20 # portage config variables and variables set directly by portage
21 - unset BAD BRACKET BUILD_PREFIX COLS \
22 + unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
23 DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
24 EBUILD_EXIT_STATUS_FILE EBUILD_FORCE_TEST EBUILD_MASTER_PID \
25 ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY \
26
27 Modified: main/trunk/pym/portage/__init__.py
28 ===================================================================
29 --- main/trunk/pym/portage/__init__.py 2009-04-30 07:32:00 UTC (rev 13559)
30 +++ main/trunk/pym/portage/__init__.py 2009-04-30 08:36:57 UTC (rev 13560)
31 @@ -1061,7 +1061,7 @@
32 # environment in order to prevent sandbox from sourcing /etc/profile
33 # in it's bashrc (causing major leakage).
34 _environ_whitelist += [
35 - "BASH_ENV", "BUILD_PREFIX", "D",
36 + "ACCEPT_LICENSE", "BASH_ENV", "BUILD_PREFIX", "D",
37 "DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD",
38 "EBUILD_EXIT_STATUS_FILE", "EBUILD_FORCE_TEST",
39 "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM",
40 @@ -2080,18 +2080,22 @@
41 big (bigger than ARG_MAX), causing execve() calls to fail with E2BIG
42 errors as in bug #262647.
43 """
44 - __slots__ = ('settings',)
45 + __slots__ = ('built_use', 'settings',)
46
47 - def __init__(self, settings):
48 + def __init__(self, built_use, settings):
49 + self.built_use = built_use
50 self.settings = settings
51
52 def __call__(self):
53 settings = self.settings
54 + use = self.built_use
55 + if use is None:
56 + use = settings['PORTAGE_USE']
57 try:
58 licenses = set(flatten(
59 dep.use_reduce(dep.paren_reduce(
60 settings['LICENSE']),
61 - uselist=settings['PORTAGE_USE'].split())))
62 + uselist=use.split())))
63 except exception.InvalidDependString:
64 licenses = set()
65 if '*' not in settings._accept_license:
66 @@ -2196,11 +2200,14 @@
67 self.modifying()
68
69 pkg = None
70 + built_use = None
71 if not isinstance(mycpv, basestring):
72 pkg = mycpv
73 mycpv = pkg.cpv
74 mydb = pkg.metadata
75 args_hash = (mycpv, id(pkg))
76 + if pkg.built:
77 + built_use = pkg.metadata['USE']
78 else:
79 args_hash = (mycpv, id(mydb))
80
81 @@ -2318,7 +2325,7 @@
82 env_configdict.pop(k, None)
83
84 env_configdict.addLazySingleton('ACCEPT_LICENSE',
85 - self._lazy_accept_license(self))
86 + self._lazy_accept_license(built_use, self))
87
88 # If reset() has not been called, it's safe to return
89 # early if IUSE has not changed.