1 |
Author: grobian |
2 |
Date: 2010-02-19 10:12:27 +0000 (Fri, 19 Feb 2010) |
3 |
New Revision: 15384 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/ebuild.sh |
7 |
main/branches/prefix/man/emerge.1 |
8 |
main/branches/prefix/pym/_emerge/Binpkg.py |
9 |
main/branches/prefix/pym/_emerge/BinpkgExtractorAsync.py |
10 |
main/branches/prefix/pym/_emerge/help.py |
11 |
main/branches/prefix/pym/portage/__init__.py |
12 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
13 |
Log: |
14 |
Merged from trunk -r15340:15350 |
15 |
|
16 |
| 15341 | Fix dblink._eerror argument where list is required instead | |
17 |
| zmedico | of string. | |
18 |
|
19 |
| 15342 | Remove unnecessary newline in dblink._eerror message. | |
20 |
| zmedico | | |
21 |
|
22 |
| 15343 | Logg errors that occur during binpkg extraction. | |
23 |
| zmedico | | |
24 |
|
25 |
| 15344 | Use os.environ instead of the config.environ(). This solves | |
26 |
| zmedico | binpkg extraction issues with catalyst stage1 due to PATH | |
27 |
| | being unset and bzip2/tar binaries not being found by bash. | |
28 |
|
29 |
| 15345 | When creating a config instance for ROOT=/ with a clean env, | |
30 |
| zmedico | copy PATH and TERM variables, since they may be useful. | |
31 |
|
32 |
| 15346 | Bug #304793 - Update --newuse docs to indicate that this | |
33 |
| zmedico | option also implies --selective. | |
34 |
|
35 |
| 15347 | Bug #262647 - Explicitly exclude SRC_URI and other | |
36 |
| zmedico | potentially long metadata variables from config.environ() | |
37 |
| | exports, to avoid potential E2BIG errors from execve calls. | |
38 |
|
39 |
| 15348 | Evaluate USE conditionals when writing vdb entries after | |
40 |
| zmedico | src_install. | |
41 |
|
42 |
| 15349 | After src_install, save fewer variables when writing the vdb | |
43 |
| zmedico | entry for a virtual package. | |
44 |
|
45 |
| 15350 | Don't save SRC_URI as a vdb entry since it's pretty useless | |
46 |
| zmedico | and it's available in environment.bz2 anyway. | |
47 |
|
48 |
|
49 |
Modified: main/branches/prefix/bin/ebuild.sh |
50 |
=================================================================== |
51 |
--- main/branches/prefix/bin/ebuild.sh 2010-02-19 10:09:31 UTC (rev 15383) |
52 |
+++ main/branches/prefix/bin/ebuild.sh 2010-02-19 10:12:27 UTC (rev 15384) |
53 |
@@ -1089,17 +1089,22 @@ |
54 |
set -f |
55 |
local f x |
56 |
IFS=$' \t\n\r' |
57 |
- for f in ASFLAGS CATEGORY CBUILD CC CFLAGS CHOST CTARGET CXX \ |
58 |
- CXXFLAGS DEFINED_PHASES DEPEND EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \ |
59 |
- FEATURES INHERITED IUSE LDFLAGS LIBCFLAGS LIBCXXFLAGS \ |
60 |
- LICENSE PDEPEND PF PKGUSE PROPERTIES PROVIDE RDEPEND RESTRICT SLOT \ |
61 |
- KEYWORDS HOMEPAGE SRC_URI DESCRIPTION; do |
62 |
+ for f in CATEGORY DEFINED_PHASES FEATURES INHERITED IUSE \ |
63 |
+ PF PKGUSE SLOT KEYWORDS HOMEPAGE DESCRIPTION ; do |
64 |
x=$(echo -n ${!f}) |
65 |
[[ -n $x ]] && echo "$x" > $f |
66 |
done |
67 |
- echo "${EPREFIX}" > EPREFIX |
68 |
+ if [[ $CATEGORY != virtual ]] ; then |
69 |
+ for f in ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX \ |
70 |
+ CXXFLAGS EXTRA_ECONF EXTRA_EINSTALL EXTRA_MAKE \ |
71 |
+ LDFLAGS LIBCFLAGS LIBCXXFLAGS ; do |
72 |
+ x=$(echo -n ${!f}) |
73 |
+ [[ -n $x ]] && echo "$x" > $f |
74 |
+ done |
75 |
+ fi |
76 |
echo "${USE}" > USE |
77 |
echo "${EAPI:-0}" > EAPI |
78 |
+ echo "${EPREFIX}" > EPREFIX |
79 |
set +f |
80 |
|
81 |
# local variables can leak into the saved environment. |
82 |
|
83 |
Modified: main/branches/prefix/man/emerge.1 |
84 |
=================================================================== |
85 |
--- main/branches/prefix/man/emerge.1 2010-02-19 10:09:31 UTC (rev 15383) |
86 |
+++ main/branches/prefix/man/emerge.1 2010-02-19 10:12:27 UTC (rev 15384) |
87 |
@@ -403,8 +403,10 @@ |
88 |
\fBmake.conf\fR(5). |
89 |
.TP |
90 |
.BR "\-\-newuse " (\fB\-N\fR) |
91 |
-Tells emerge to include installed packages where USE flags have changed since |
92 |
-compilation. USE flag changes include: |
93 |
+Tells emerge to include installed packages where USE |
94 |
+flags have changed since compilation. This option |
95 |
+also implies the \fB\-\-selective\fR option. |
96 |
+USE flag changes include: |
97 |
|
98 |
A USE flag was added to a package. |
99 |
A USE flag was removed from a package. |
100 |
|
101 |
Modified: main/branches/prefix/pym/_emerge/Binpkg.py |
102 |
=================================================================== |
103 |
--- main/branches/prefix/pym/_emerge/Binpkg.py 2010-02-19 10:09:31 UTC (rev 15383) |
104 |
+++ main/branches/prefix/pym/_emerge/Binpkg.py 2010-02-19 10:12:27 UTC (rev 15384) |
105 |
@@ -22,6 +22,7 @@ |
106 |
else: |
107 |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym")) |
108 |
import portage |
109 |
+import logging |
110 |
from portage.output import colorize |
111 |
from portage.const import EPREFIX |
112 |
|
113 |
@@ -303,15 +304,17 @@ |
114 |
|
115 |
extractor = BinpkgExtractorAsync(background=self.background, |
116 |
image_dir=pkgloc, |
117 |
- pkg=self.pkg, pkg_path=self._pkg_path, scheduler=self.scheduler) |
118 |
+ pkg=self.pkg, pkg_path=self._pkg_path, |
119 |
+ logfile=self.settings.get("PORTAGE_LOG_FILE"), |
120 |
+ scheduler=self.scheduler) |
121 |
self._writemsg_level(">>> Extracting %s\n" % self.pkg.cpv) |
122 |
self._start_task(extractor, self._extractor_exit) |
123 |
|
124 |
def _extractor_exit(self, extractor): |
125 |
if self._final_exit(extractor) != os.EX_OK: |
126 |
self._unlock_builddir() |
127 |
- writemsg("!!! Error Extracting '%s'\n" % self._pkg_path, |
128 |
- noiselevel=-1) |
129 |
+ self._writemsg_level("!!! Error Extracting '%s'\n" % \ |
130 |
+ self._pkg_path, noiselevel=-1, level=logging.ERROR) |
131 |
self.wait() |
132 |
return |
133 |
|
134 |
|
135 |
Modified: main/branches/prefix/pym/_emerge/BinpkgExtractorAsync.py |
136 |
=================================================================== |
137 |
--- main/branches/prefix/pym/_emerge/BinpkgExtractorAsync.py 2010-02-19 10:09:31 UTC (rev 15383) |
138 |
+++ main/branches/prefix/pym/_emerge/BinpkgExtractorAsync.py 2010-02-19 10:12:27 UTC (rev 15384) |
139 |
@@ -11,6 +11,7 @@ |
140 |
else: |
141 |
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym")) |
142 |
import portage |
143 |
+ |
144 |
class BinpkgExtractorAsync(SpawnProcess): |
145 |
|
146 |
__slots__ = ("image_dir", "pkg", "pkg_path") |
147 |
@@ -19,10 +20,15 @@ |
148 |
|
149 |
def _start(self): |
150 |
self.args = [self._shell_binary, "-c", |
151 |
- "bzip2 -dqc -- %s | tar -xp -C %s -f -" % \ |
152 |
+ ("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \ |
153 |
+ "p=(${PIPESTATUS[@]}) ; " + \ |
154 |
+ "if [ ${p[0]} != 0 ] ; then " + \ |
155 |
+ "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \ |
156 |
+ "if [ ${p[1]} != 0 ] ; then " + \ |
157 |
+ "echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \ |
158 |
+ "exit 0 ;") % \ |
159 |
(portage._shell_quote(self.pkg_path), |
160 |
portage._shell_quote(self.image_dir))] |
161 |
|
162 |
- self.env = self.pkg.root_config.settings.environ() |
163 |
+ self.env = os.environ.copy() |
164 |
SpawnProcess._start(self) |
165 |
- |
166 |
|
167 |
Modified: main/branches/prefix/pym/_emerge/help.py |
168 |
=================================================================== |
169 |
--- main/branches/prefix/pym/_emerge/help.py 2010-02-19 10:09:31 UTC (rev 15383) |
170 |
+++ main/branches/prefix/pym/_emerge/help.py 2010-02-19 10:12:27 UTC (rev 15384) |
171 |
@@ -442,8 +442,11 @@ |
172 |
print(desc_indent + line) |
173 |
print() |
174 |
print(" "+green("--newuse")+" ("+green("-N")+" short option)") |
175 |
- print(" Tells emerge to include installed packages where USE flags have ") |
176 |
- print(" changed since installation.") |
177 |
+ desc = "Tells emerge to include installed packages where USE " + \ |
178 |
+ "flags have changed since compilation. This option " + \ |
179 |
+ "also implies the --selective option." |
180 |
+ for line in wrap(desc, desc_width): |
181 |
+ print(desc_indent + line) |
182 |
print() |
183 |
print(" "+green("--noconfmem")) |
184 |
print(" Portage keeps track of files that have been placed into") |
185 |
|
186 |
Modified: main/branches/prefix/pym/portage/__init__.py |
187 |
=================================================================== |
188 |
--- main/branches/prefix/pym/portage/__init__.py 2010-02-19 10:09:31 UTC (rev 15383) |
189 |
+++ main/branches/prefix/pym/portage/__init__.py 2010-02-19 10:12:27 UTC (rev 15384) |
190 |
@@ -1382,12 +1382,10 @@ |
191 |
virtuals ...etc you look in here. |
192 |
""" |
193 |
|
194 |
- # Don't include anything that could be extremely long here (like SRC_URI) |
195 |
- # since that could cause execve() calls to fail with E2BIG errors. For |
196 |
- # example, see bug #262647. |
197 |
- _setcpv_aux_keys = ('SLOT', 'RESTRICT', 'LICENSE', |
198 |
- 'KEYWORDS', 'INHERITED', 'IUSE', 'PROVIDE', 'EAPI', |
199 |
- 'PROPERTIES', 'DEFINED_PHASES', 'repository') |
200 |
+ _setcpv_aux_keys = ('DEFINED_PHASES', 'DEPEND', 'EAPI', |
201 |
+ 'INHERITED', 'IUSE', 'KEYWORDS', 'LICENSE', 'PDEPEND', |
202 |
+ 'PROPERTIES', 'PROVIDE', 'RDEPEND', 'SLOT', |
203 |
+ 'repository', 'RESTRICT', 'LICENSE',) |
204 |
|
205 |
_env_blacklist = [ |
206 |
"A", "AA", "CATEGORY", "DEPEND", "DESCRIPTION", "EAPI", |
207 |
@@ -1486,6 +1484,13 @@ |
208 |
# they don't needlessly propagate down into the ebuild environment. |
209 |
_environ_filter = [] |
210 |
|
211 |
+ # Exclude anything that could be extremely long here (like SRC_URI) |
212 |
+ # since that could cause execve() calls to fail with E2BIG errors. For |
213 |
+ # example, see bug #262647. |
214 |
+ _environ_filter += [ |
215 |
+ 'DEPEND', 'RDEPEND', 'PDEPEND', 'SRC_URI', |
216 |
+ ] |
217 |
+ |
218 |
# misc variables inherited from the calling environment |
219 |
_environ_filter += [ |
220 |
"INFOPATH", "MANPATH", "USER", |
221 |
@@ -5883,6 +5888,9 @@ |
222 |
write_atomic(os.path.join(settings['PORTAGE_BUILDDIR'], |
223 |
'build-info', 'CHOST'), chost + '\n') |
224 |
|
225 |
+_vdb_use_conditional_keys = ('DEPEND', 'LICENSE', 'PDEPEND', |
226 |
+ 'PROPERTIES', 'PROVIDE', 'RDEPEND', 'RESTRICT',) |
227 |
+ |
228 |
def _post_src_install_uid_fix(mysettings, out=None): |
229 |
""" |
230 |
Files in $D with user and group bits that match the "portage" |
231 |
@@ -5985,9 +5993,30 @@ |
232 |
for l in _merge_unicode_error(unicode_errors): |
233 |
eerror(l, phase='install', key=mysettings.mycpv, out=out) |
234 |
|
235 |
- open(_unicode_encode(os.path.join(mysettings['PORTAGE_BUILDDIR'], |
236 |
- 'build-info', 'SIZE')), 'w').write(str(size) + '\n') |
237 |
+ build_info_dir = os.path.join(mysettings['PORTAGE_BUILDDIR'], |
238 |
+ 'build-info') |
239 |
|
240 |
+ codecs.open(_unicode_encode(os.path.join(build_info_dir, |
241 |
+ 'SIZE'), encoding=_encodings['fs'], errors='strict'), |
242 |
+ 'w', encoding=_encodings['repo.content'], |
243 |
+ errors='strict').write(str(size) + '\n') |
244 |
+ |
245 |
+ use = frozenset(mysettings['PORTAGE_USE'].split()) |
246 |
+ for k in _vdb_use_conditional_keys: |
247 |
+ v = mysettings.configdict['pkg'].get(k) |
248 |
+ if v is None: |
249 |
+ continue |
250 |
+ v = dep.paren_reduce(v) |
251 |
+ v = dep.use_reduce(v, uselist=use) |
252 |
+ v = dep.paren_normalize(v) |
253 |
+ v = dep.paren_enclose(v) |
254 |
+ if not v: |
255 |
+ continue |
256 |
+ codecs.open(_unicode_encode(os.path.join(build_info_dir, |
257 |
+ k), encoding=_encodings['fs'], errors='strict'), |
258 |
+ mode='w', encoding=_encodings['repo.content'], |
259 |
+ errors='strict').write(v + '\n') |
260 |
+ |
261 |
if bsd_chflags: |
262 |
# Restore all of the flags saved above. |
263 |
os.system("mtree -e -p %s -U -k flags < %s > /dev/null" % \ |
264 |
@@ -9252,8 +9281,13 @@ |
265 |
|
266 |
# When ROOT != "/" we only want overrides from the calling |
267 |
# environment to apply to the config that's associated |
268 |
- # with ROOT != "/", so pass an empty dict for the env parameter. |
269 |
- settings = config(config_root=None, target_root="/", env={}) |
270 |
+ # with ROOT != "/", so pass a nearly empty dict for the env parameter. |
271 |
+ clean_env = {} |
272 |
+ for k in ('PATH', 'TERM'): |
273 |
+ v = settings.get(k) |
274 |
+ if v is not None: |
275 |
+ clean_env[k] = v |
276 |
+ settings = config(config_root=None, target_root="/", env=clean_env) |
277 |
settings.lock() |
278 |
myroots.append((settings["ROOT"], settings)) |
279 |
|
280 |
|
281 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
282 |
=================================================================== |
283 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-19 10:09:31 UTC (rev 15383) |
284 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-19 10:12:27 UTC (rev 15384) |
285 |
@@ -3455,7 +3455,8 @@ |
286 |
# like hell and continue to hopefully finish all our |
287 |
# administrative and pkg_postinst stuff. |
288 |
self._eerror("postrm", |
289 |
- "Could not chmod or unlink '%s': %s\n" % (file_name, ose)) |
290 |
+ ["Could not chmod or unlink '%s': %s" % \ |
291 |
+ (file_name, ose)]) |
292 |
finally: |
293 |
if bsd_chflags and pflags != 0: |
294 |
# Restore the parent flags we saved before unlinking |