Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13592 - in main/branches/prefix: . bin pym/portage
Date: Sat, 02 May 2009 09:20:42
Message-Id: E1M0BOi-000451-1r@stork.gentoo.org
1 Author: grobian
2 Date: 2009-05-02 09:20:39 +0000 (Sat, 02 May 2009)
3 New Revision: 13592
4
5 Modified:
6 main/branches/prefix/RELEASE-NOTES
7 main/branches/prefix/bin/isolated-functions.sh
8 main/branches/prefix/pym/portage/__init__.py
9 Log:
10 Merged from trunk -r13414:13563
11
12 | 13415 | Exclude 'backupenv' from config.configlist and lookuplist |
13 | zmedico | since it doesn't make size to have it in there when |
14 | | configdict['env'] already serves that purpose. This allows |
15 | | values to be temporarily removed from configdict['env'] and |
16 | | have them not appear in the environment until reset() is |
17 | | called to restore those values from the backupenv. |
18
19 | 13416 | In config.regenerate(), explicitly include self.backupenv |
20 | zmedico | when processing incrementals, since it's no longer included |
21 | | in self.configlist. |
22
23 | 13417 | Generate a pruned version of ACCEPT_LICENSE, by intersection |
24 | zmedico | with LICENSE. This is required since otherwise |
25 | | ACCEPT_LICENSE might be too big (bigger than ARG_MAX), |
26 | | causing execve() calls to fail with E2BIG errors as in bug |
27 | | #262647. |
28
29 | 13418 | In config.setcpv(), move the code that makes sure "pkg" |
30 | zmedico | values override "env" values _after_ the reset() call. |
31
32 | 13419 | Fix error in calculations from bug #267104. |
33 | zmedico | |
34
35 | 13560 | Fix ACCEPT_LICENSE handling for binary packages, so that the |
36 | zmedico | build-time USE settings are used calculate an appropriate |
37 | | ACCEPT_LICENSE value. |
38
39 | 13562 | Add note about repos.conf eclass overrides. |
40 | zmedico | |
41
42 | 13563 | Fix typo in version from previous commit. |
43 | zmedico | |
44
45
46 Modified: main/branches/prefix/RELEASE-NOTES
47 ===================================================================
48 --- main/branches/prefix/RELEASE-NOTES 2009-05-02 09:18:01 UTC (rev 13591)
49 +++ main/branches/prefix/RELEASE-NOTES 2009-05-02 09:20:39 UTC (rev 13592)
50 @@ -21,6 +21,12 @@
51 * "world" no longer includes "system" unconditionally, but you can add
52 "@system" to the world_sets file to restore the old state.
53
54 +portage-2.1.6.12
55 +==================================
56 +* If you want overlay eclasses to override eclasses from other repos then see
57 + the portage(5) man page for information about the new layout.conf and
58 + repos.conf configuration files.
59 +
60 portage-2.1.6
61 ==================================
62
63
64 Modified: main/branches/prefix/bin/isolated-functions.sh
65 ===================================================================
66 --- main/branches/prefix/bin/isolated-functions.sh 2009-05-02 09:18:01 UTC (rev 13591)
67 +++ main/branches/prefix/bin/isolated-functions.sh 2009-05-02 09:20:39 UTC (rev 13592)
68 @@ -524,7 +524,7 @@
69 ${QA_INTERCEPTORS}
70
71 # portage config variables and variables set directly by portage
72 - unset BAD BRACKET BUILD_PREFIX COLS \
73 + unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \
74 DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
75 EBUILD_EXIT_STATUS_FILE EBUILD_FORCE_TEST EBUILD_MASTER_PID \
76 ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY \
77
78 Modified: main/branches/prefix/pym/portage/__init__.py
79 ===================================================================
80 --- main/branches/prefix/pym/portage/__init__.py 2009-05-02 09:18:01 UTC (rev 13591)
81 +++ main/branches/prefix/pym/portage/__init__.py 2009-05-02 09:20:39 UTC (rev 13592)
82 @@ -1062,7 +1062,7 @@
83 # environment in order to prevent sandbox from sourcing /etc/profile
84 # in it's bashrc (causing major leakage).
85 _environ_whitelist += [
86 - "BASH_ENV", "BUILD_PREFIX", "D",
87 + "ACCEPT_LICENSE", "BASH_ENV", "BUILD_PREFIX", "D",
88 "DISTDIR", "DOC_SYMLINKS_DIR", "EBUILD",
89 "EBUILD_EXIT_STATUS_FILE", "EBUILD_FORCE_TEST",
90 "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "EMERGE_FROM",
91 @@ -1264,19 +1264,19 @@
92 self.mycpv = copy.deepcopy(clone.mycpv)
93 self._setcpv_args_hash = copy.deepcopy(clone._setcpv_args_hash)
94
95 - self.configlist = copy.deepcopy(clone.configlist)
96 + self.configdict = copy.deepcopy(clone.configdict)
97 + self.configlist = [
98 + self.configdict['env.d'],
99 + self.configdict['pkginternal'],
100 + self.configdict['globals'],
101 + self.configdict['defaults'],
102 + self.configdict['conf'],
103 + self.configdict['pkg'],
104 + self.configdict['auto'],
105 + self.configdict['env'],
106 + ]
107 self.lookuplist = self.configlist[:]
108 self.lookuplist.reverse()
109 - self.configdict = {
110 - "env.d": self.configlist[0],
111 - "pkginternal": self.configlist[1],
112 - "globals": self.configlist[2],
113 - "defaults": self.configlist[3],
114 - "conf": self.configlist[4],
115 - "pkg": self.configlist[5],
116 - "auto": self.configlist[6],
117 - "backupenv": self.configlist[7],
118 - "env": self.configlist[8] }
119 self._use_expand_dict = copy.deepcopy(clone._use_expand_dict)
120 self.profiles = copy.deepcopy(clone.profiles)
121 self.backupenv = self.configdict["backupenv"]
122 @@ -1586,8 +1586,7 @@
123 self.configlist.append({})
124 self.configdict["auto"]=self.configlist[-1]
125
126 - self.configlist.append(self.backupenv) # XXX Why though?
127 - self.configdict["backupenv"]=self.configlist[-1]
128 + self.configdict["backupenv"] = self.backupenv
129
130 # Don't allow the user to override certain variables in the env
131 for k in profile_only_variables:
132 @@ -2089,6 +2088,35 @@
133 DeprecationWarning)
134 return 1
135
136 + class _lazy_accept_license(object):
137 + """
138 + Generate a pruned version of ACCEPT_LICENSE, by intersection with
139 + LICENSE. This is required since otherwise ACCEPT_LICENSE might be too
140 + big (bigger than ARG_MAX), causing execve() calls to fail with E2BIG
141 + errors as in bug #262647.
142 + """
143 + __slots__ = ('built_use', 'settings',)
144 +
145 + def __init__(self, built_use, settings):
146 + self.built_use = built_use
147 + self.settings = settings
148 +
149 + def __call__(self):
150 + settings = self.settings
151 + use = self.built_use
152 + if use is None:
153 + use = settings['PORTAGE_USE']
154 + try:
155 + licenses = set(flatten(
156 + dep.use_reduce(dep.paren_reduce(
157 + settings['LICENSE']),
158 + uselist=use.split())))
159 + except exception.InvalidDependString:
160 + licenses = set()
161 + if '*' not in settings._accept_license:
162 + licenses.intersection_update(settings._accept_license)
163 + return ' '.join(sorted(licenses))
164 +
165 class _lazy_use_expand(object):
166 """
167 Lazily evaluate USE_EXPAND variables since they are only needed when
168 @@ -2187,11 +2215,14 @@
169 self.modifying()
170
171 pkg = None
172 + built_use = None
173 if not isinstance(mycpv, basestring):
174 pkg = mycpv
175 mycpv = pkg.cpv
176 mydb = pkg.metadata
177 args_hash = (mycpv, id(pkg))
178 + if pkg.built:
179 + built_use = pkg.metadata['USE']
180 else:
181 args_hash = (mycpv, id(mydb))
182
183 @@ -2206,7 +2237,6 @@
184 cpv_slot = self.mycpv
185 pkginternaluse = ""
186 iuse = ""
187 - env_configdict = self.configdict["env"]
188 pkg_configdict = self.configdict["pkg"]
189 previous_iuse = pkg_configdict.get("IUSE")
190
191 @@ -2232,9 +2262,6 @@
192 repository = pkg_configdict.pop("repository", None)
193 if repository is not None:
194 pkg_configdict["PORTAGE_REPO_NAME"] = repository
195 - for k in pkg_configdict:
196 - if k != "USE":
197 - env_configdict.pop(k, None)
198 slot = pkg_configdict["SLOT"]
199 iuse = pkg_configdict["IUSE"]
200 if pkg is None:
201 @@ -2304,6 +2331,17 @@
202 if has_changed:
203 self.reset(keeping_pkg=1,use_cache=use_cache)
204
205 + # Ensure that "pkg" values are always preferred over "env" values.
206 + # This must occur _after_ the above reset() call, since reset()
207 + # copies values from self.backupenv.
208 + env_configdict = self.configdict['env']
209 + for k in pkg_configdict:
210 + if k != 'USE':
211 + env_configdict.pop(k, None)
212 +
213 + env_configdict.addLazySingleton('ACCEPT_LICENSE',
214 + self._lazy_accept_license(built_use, self))
215 +
216 # If reset() has not been called, it's safe to return
217 # early if IUSE has not changed.
218 if not has_changed and previous_iuse == iuse:
219 @@ -2805,6 +2843,7 @@
220 for mykey in myincrementals:
221
222 mydbs=self.configlist[:-1]
223 + mydbs.append(self.backupenv)
224
225 myflags=[]
226 for curdb in mydbs:
227 @@ -3973,8 +4012,8 @@
228 has_space = False
229 elif userfetch:
230 has_space = False
231 - elif (size - mysize + vfs_stat.f_bfree) >= \
232 - (vfs_stat.f_bfree * vfs_stat.f_bavail):
233 + elif (size - mysize + vfs_stat.f_bsize) >= \
234 + (vfs_stat.f_bsize * vfs_stat.f_bfree):
235 has_space = False
236
237 if not has_space: