Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12037 - in main/branches/prefix: bin cnf man pym/_emerge pym/portage pym/portage/cache
Date: Sat, 22 Nov 2008 11:31:18
Message-Id: E1L3qhn-0001sa-Jz@stork.gentoo.org
1 Author: grobian
2 Date: 2008-11-22 11:31:14 +0000 (Sat, 22 Nov 2008)
3 New Revision: 12037
4
5 Modified:
6 main/branches/prefix/bin/emake
7 main/branches/prefix/cnf/make.globals
8 main/branches/prefix/man/ebuild.1
9 main/branches/prefix/man/emerge.1
10 main/branches/prefix/man/make.conf.5
11 main/branches/prefix/pym/_emerge/__init__.py
12 main/branches/prefix/pym/portage/__init__.py
13 main/branches/prefix/pym/portage/cache/flat_hash.py
14 main/branches/prefix/pym/portage/cache/fs_template.py
15 main/branches/prefix/pym/portage/cache/metadata.py
16 main/branches/prefix/pym/portage/cache/template.py
17 main/branches/prefix/pym/portage/cache/util.py
18 main/branches/prefix/pym/portage/eclass_cache.py
19 Log:
20 Merged from trunk -r11982:12004
21
22 | 11984 | Bug #139134 - Make the flat_hash and metadata modules write |
23 | zmedico | the _mtime_ field inside the file instead of mangling the |
24 | | mtime of the cache entry file. Also, fix |
25 | | FsBased._ensure_access() to properly skip the utime() call |
26 | | when no mtime is passed in. Theses cache changes are |
27 | | compatible with current stable portage (2.1.4.x), which |
28 | | uses the _mtime_ field contained in the file when |
29 | | available. |
30
31 | 11986 | Store the _eclasses_ field instead of INHERITED. |
32 | zmedico | |
33
34 | 11988 | include quotes when showing make output |
35 | SpankMan | |
36
37 | 11990 | For emerge --metadata runs, update _eclasses_ metadata to |
38 | zmedico | insert local eclass paths. |
39
40 | 11992 | Make serialize_eclasses() sort eclass names. |
41 | zmedico | |
42
43 | 11994 | When warning about 'missing repo_name', also give the exact |
44 | zmedico | path where the entry should exist, and explain that it |
45 | | should be a plain text file containing a unique name of the |
46 | | first line. This should give the users enough information |
47 | | to correct the problem without needing to seek help. |
48
49 | 11995 | Move the repo_name check/warning into a function. |
50 | zmedico | |
51
52 | 11997 | Bug #245779 - Document the new category subdirectory |
53 | zmedico | behavior for PKGDIR. |
54
55 | 11999 | Bug #245716 - When generating QA notices for 'command not |
56 | zmedico | found' messages in the build log, exclude messages that are |
57 | | emitted from configure scripts since those are normal in |
58 | | some cases. |
59
60 | 12001 | Remove --fetchonly --resume time.sleep() call which is an |
61 | zmedico | artifact from the previous parallel-fetch implementation. |
62
63 | 12003 | Bug #247625 - Update PORTAGE_IONICE_COMMAND docs to reflect |
64 | zmedico | that it is unset by default. |
65
66 | 12004 | Remove PORTAGE_IONICE_COMMAND setting since it's commented |
67 | zmedico | out. |
68
69
70 Modified: main/branches/prefix/bin/emake
71 ===================================================================
72 --- main/branches/prefix/bin/emake 2008-11-22 11:29:10 UTC (rev 12036)
73 +++ main/branches/prefix/bin/emake 2008-11-22 11:31:14 UTC (rev 12037)
74 @@ -11,6 +11,15 @@
75 # /etc/make.globals here because emake is only called from an
76 # ebuild.
77
78 -[[ $PORTAGE_QUIET = 1 ]] || echo ${MAKE:-make} $MAKEOPTS $EXTRA_EMAKE "$@" >&2
79 +if [[ $PORTAGE_QUIET != 1 ]] ; then
80 + (
81 + for arg in ${MAKE:-make} $MAKEOPTS $EXTRA_EMAKE "$@" ; do
82 + [[ ${arg} == *" "* ]] \
83 + && printf "'%s' " "${arg}" \
84 + || printf "%s " "${arg}"
85 + done
86 + printf "\n"
87 + ) >&2
88 +fi
89
90 exec ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
91
92 Modified: main/branches/prefix/cnf/make.globals
93 ===================================================================
94 --- main/branches/prefix/cnf/make.globals 2008-11-22 11:29:10 UTC (rev 12036)
95 +++ main/branches/prefix/cnf/make.globals 2008-11-22 11:31:14 UTC (rev 12037)
96 @@ -71,10 +71,6 @@
97 # Minimum size of existing file for RESUMECOMMAND to be called.
98 PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
99
100 -# Command called to adjust the io priority of portage and it's subprocesses.
101 -# Note: should be wrapped inside a uid check
102 -#PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
103 -
104 # Number of times 'emerge --sync' will run before giving up.
105 PORTAGE_RSYNC_RETRIES="3"
106
107
108 Modified: main/branches/prefix/man/ebuild.1
109 ===================================================================
110 --- main/branches/prefix/man/ebuild.1 2008-11-22 11:29:10 UTC (rev 12036)
111 +++ main/branches/prefix/man/ebuild.1 2008-11-22 11:31:14 UTC (rev 12037)
112 @@ -161,9 +161,7 @@
113 .BR package
114 This command is a lot like the \fImerge\fR command, except that after
115 fetching, unpacking, compiling and installing, a .tbz2 binary package
116 -tarball is created and stored in ${PKGDIR}/All (${PKGDIR} defaults to
117 -/usr/portage/packages). A symbolic link is created in
118 -${PKGDIR}/${CATEGORY} that points to the package in ${PKGDIR}/All.
119 +tarball is created and stored in \fBPKGDIR\fR (see \fBmake.conf\fR(5)).
120 .TP
121 .BR rpm
122 Builds a RedHat RPM package from the files in the temporary
123
124 Modified: main/branches/prefix/man/emerge.1
125 ===================================================================
126 --- main/branches/prefix/man/emerge.1 2008-11-22 11:29:10 UTC (rev 12036)
127 +++ main/branches/prefix/man/emerge.1 2008-11-22 11:31:14 UTC (rev 12037)
128 @@ -246,8 +246,8 @@
129 addition to actually merging the packages. Useful for maintainers
130 or if you administrate multiple Gentoo Linux systems (build once,
131 emerge tbz2s everywhere) as well as disaster recovery. The package
132 -will be created in the
133 -\fI${PKGDIR}/All\fR directory. An alternative for already\-merged
134 +will be created in the \fBPKGDIR\fR directory (see \fBmake.conf\fR(5)).
135 +An alternative for already\-merged
136 packages is to use \fBquickpkg\fR(1) which creates a tbz2 from the
137 live filesystem.
138 .TP
139
140 Modified: main/branches/prefix/man/make.conf.5
141 ===================================================================
142 --- main/branches/prefix/man/make.conf.5 2008-11-22 11:29:10 UTC (rev 12036)
143 +++ main/branches/prefix/man/make.conf.5 2008-11-22 11:31:14 UTC (rev 12037)
144 @@ -401,7 +401,13 @@
145 Defaults to false.
146 .TP
147 \fBPKGDIR\fR = \fI[path]\fR
148 -Defines the location where created .tbz2 binary packages will be stored. Note
149 +Defines the location where created .tbz2 binary packages will be
150 +stored when the \fBemerge\fR(1) \fB\-\-buildpkg\fR option is enabled.
151 +By default, a given package is stored in a subdirectory corresponding
152 +to it's category. However, for backward compatibility with the layout
153 +used by older versions of portage, if the \fI${PKGDIR}/All\fR directory
154 +exists then all packages will be stored inside of it and symlinks to
155 +the packages will be created in the category subdirectories. Note
156 that locations under /usr/portage are not necessarily safe for data storage.
157 See the \fBPORTDIR\fR documentation for more information.
158 .br
159 @@ -482,11 +488,9 @@
160 This variable should contain a command for portage to call in order
161 to adjust the io priority of portage and it's subprocesses. The command
162 string should contain a \\${PID} place-holder that will be substituted
163 -with an integer pid. For more information about ionice, see \fBionice\fR(1).
164 -Set this variable to an empty string if you do not want portage to call
165 -ionice.
166 -.br
167 -Defaults to "ionice -c 3 -p \\${PID}".
168 +with an integer pid. For example, a value of "ionice \-c 3 \-p \\${PID}"
169 +will set idle io priority. For more information about ionice, see
170 +\fBionice\fR(1). This variable is unset by default.
171 .TP
172 \fBPORTAGE_NICENESS\fR = \fI[number]\fR
173 The value of this variable will be added to the current nice level that
174
175 Modified: main/branches/prefix/pym/_emerge/__init__.py
176 ===================================================================
177 --- main/branches/prefix/pym/_emerge/__init__.py 2008-11-22 11:29:10 UTC (rev 12036)
178 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-11-22 11:31:14 UTC (rev 12037)
179 @@ -13338,11 +13338,6 @@
180
181 if ("--resume" in myopts):
182 favorites=mtimedb["resume"]["favorites"]
183 - if "PORTAGE_PARALLEL_FETCHONLY" in settings:
184 - """ parallel-fetch uses --resume --fetchonly and we don't want
185 - it to write the mtimedb"""
186 - mtimedb.filename = None
187 - time.sleep(3) # allow the parent to have first fetch
188 mymergelist = mydepgraph.altlist()
189 mydepgraph.break_refs(mymergelist)
190 mergetask = Scheduler(settings, trees, mtimedb, myopts,
191 @@ -13934,6 +13929,32 @@
192 newargs.append(a)
193 return (newargs, retval)
194
195 +def repo_name_check(trees):
196 + missing_repo_names = set()
197 + for root, root_trees in trees.iteritems():
198 + if "porttree" in root_trees:
199 + portdb = root_trees["porttree"].dbapi
200 + missing_repo_names.update(portdb.porttrees)
201 + repos = portdb.getRepositories()
202 + for r in repos:
203 + missing_repo_names.discard(portdb.getRepositoryPath(r))
204 +
205 + if missing_repo_names:
206 + msg = []
207 + msg.append("WARNING: One or more repositories " + \
208 + "have missing repo_name entries:")
209 + msg.append("")
210 + for p in missing_repo_names:
211 + msg.append("\t%s/profiles/repo_name" % (p,))
212 + msg.append("")
213 + msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \
214 + "should be a plain text file containing a unique " + \
215 + "name for the repository on the first line.", 70))
216 + writemsg_level("".join("%s\n" % l for l in msg),
217 + level=logging.WARNING, noiselevel=-1)
218 +
219 + return bool(missing_repo_names)
220 +
221 def emerge_main():
222 global portage # NFC why this is necessary now - genone
223 portage._disable_legacy_globals()
224 @@ -13994,21 +14015,7 @@
225
226 if "--quiet" not in myopts:
227 portage.deprecated_profile_check()
228 - for root in trees:
229 - if "porttree" in trees[root]:
230 - db = trees[root]["porttree"].dbapi
231 - paths = (db.mysettings["PORTDIR"]+" "+db.mysettings["PORTDIR_OVERLAY"]).split()
232 - paths = [os.path.realpath(p) for p in paths]
233 - repos = db.getRepositories()
234 - for r in repos:
235 - p = db.getRepositoryPath(r)
236 - try:
237 - paths.remove(p)
238 - except ValueError:
239 - pass
240 - for p in paths:
241 - writemsg("WARNING: repository at %s is missing a repo_name entry\n" % p)
242 -
243 + repo_name_check(trees)
244
245 eclasses_overridden = {}
246 for mytrees in trees.itervalues():
247
248 Modified: main/branches/prefix/pym/portage/__init__.py
249 ===================================================================
250 --- main/branches/prefix/pym/portage/__init__.py 2008-11-22 11:29:10 UTC (rev 12036)
251 +++ main/branches/prefix/pym/portage/__init__.py 2008-11-22 11:31:14 UTC (rev 12037)
252 @@ -4529,6 +4529,7 @@
253 bash_command_not_found = []
254 bash_command_not_found_re = re.compile(
255 r'(.*): line (\d*): (.*): command not found$')
256 + command_not_found_exclude_re = re.compile(r'/configure: line ')
257 helper_missing_file = []
258 helper_missing_file_re = re.compile(
259 r'^!!! (do|new).*: .* does not exist$')
260 @@ -4550,7 +4551,8 @@
261 am_maintainer_mode_exclude_re.search(line) is None:
262 am_maintainer_mode.append(line.rstrip("\n"))
263
264 - if bash_command_not_found_re.match(line) is not None:
265 + if bash_command_not_found_re.match(line) is not None and \
266 + command_not_found_exclude_re.search(line) is None:
267 bash_command_not_found.append(line.rstrip("\n"))
268
269 if helper_missing_file_re.match(line) is not None:
270
271 Modified: main/branches/prefix/pym/portage/cache/flat_hash.py
272 ===================================================================
273 --- main/branches/prefix/pym/portage/cache/flat_hash.py 2008-11-22 11:29:10 UTC (rev 12036)
274 +++ main/branches/prefix/pym/portage/cache/flat_hash.py 2008-11-22 11:31:14 UTC (rev 12037)
275 @@ -18,6 +18,7 @@
276 self.label.lstrip(os.path.sep).rstrip(os.path.sep))
277 write_keys = set(self._known_keys)
278 write_keys.add("_eclasses_")
279 + write_keys.add("_mtime_")
280 self._write_keys = sorted(write_keys)
281 if not self.readonly and not os.path.exists(self.location):
282 self._ensure_dirs()
283 @@ -83,7 +84,7 @@
284 myf.write("%s=%s\n" % (k, v))
285 finally:
286 myf.close()
287 - self._ensure_access(fp, mtime=values["_mtime_"])
288 + self._ensure_access(fp)
289
290 #update written. now we move it.
291
292
293 Modified: main/branches/prefix/pym/portage/cache/fs_template.py
294 ===================================================================
295 --- main/branches/prefix/pym/portage/cache/fs_template.py 2008-11-22 11:29:10 UTC (rev 12036)
296 +++ main/branches/prefix/pym/portage/cache/fs_template.py 2008-11-22 11:31:14 UTC (rev 12037)
297 @@ -36,7 +36,7 @@
298 try:
299 os.chown(path, -1, self._gid)
300 os.chmod(path, self._perms)
301 - if mtime:
302 + if mtime != -1:
303 mtime=long(mtime)
304 os.utime(path, (mtime, mtime))
305 except (OSError, IOError):
306
307 Modified: main/branches/prefix/pym/portage/cache/metadata.py
308 ===================================================================
309 --- main/branches/prefix/pym/portage/cache/metadata.py 2008-11-22 11:29:10 UTC (rev 12036)
310 +++ main/branches/prefix/pym/portage/cache/metadata.py 2008-11-22 11:31:14 UTC (rev 12037)
311 @@ -78,12 +78,4 @@
312
313
314 def _setitem(self, cpv, values):
315 - values = ProtectedDict(values)
316 -
317 - # hack. proper solution is to make this a __setitem__ override, since template.__setitem__
318 - # serializes _eclasses_, then we reconstruct it.
319 - if "_eclasses_" in values:
320 - values["INHERITED"] = ' '.join(reconstruct_eclasses(cpv, values["_eclasses_"]).keys())
321 - del values["_eclasses_"]
322 -
323 flat_hash.database._setitem(self, cpv, values)
324
325 Modified: main/branches/prefix/pym/portage/cache/template.py
326 ===================================================================
327 --- main/branches/prefix/pym/portage/cache/template.py 2008-11-22 11:29:10 UTC (rev 12036)
328 +++ main/branches/prefix/pym/portage/cache/template.py 2008-11-22 11:31:14 UTC (rev 12037)
329 @@ -189,8 +189,8 @@
330 """
331 if not eclass_dict:
332 return ""
333 - return "\t".join(["%s\t%s\t%s" % (k, v[0], str(v[1])) \
334 - for k, v in eclass_dict.iteritems()])
335 + return "\t".join(k + "\t%s\t%s" % eclass_dict[k] \
336 + for k in sorted(eclass_dict))
337
338 def reconstruct_eclasses(cpv, eclass_string):
339 """returns a dict when handed a string generated by serialize_eclasses"""
340
341 Modified: main/branches/prefix/pym/portage/cache/util.py
342 ===================================================================
343 --- main/branches/prefix/pym/portage/cache/util.py 2008-11-22 11:29:10 UTC (rev 12036)
344 +++ main/branches/prefix/pym/portage/cache/util.py 2008-11-22 11:31:14 UTC (rev 12037)
345 @@ -3,6 +3,8 @@
346 # License: GPL2
347 # $Id$
348
349 +__all__ = ["mirror_cache", "non_quiet_mirroring", "quiet_mirroring"]
350 +
351 from itertools import chain
352 from portage.cache import cache_errors
353
354 @@ -65,26 +67,35 @@
355
356 if write_it:
357 try:
358 - inherited = entry.get("INHERITED", None)
359 + inherited = entry.get("INHERITED", "")
360 + eclasses = entry.get("_eclasses_")
361 except cache_errors.CacheError, ce:
362 noise.exception(x, ce)
363 del ce
364 continue
365 +
366 + if eclasses is not None:
367 + if not eclass_cache.is_eclass_data_valid(entry["_eclasses_"]):
368 + noise.eclass_stale(x)
369 + continue
370 + inherited = eclasses
371 + else:
372 + inherited = inherited.split()
373 +
374 if inherited:
375 - if src_cache.complete_eclass_entries:
376 - if not "_eclasses_" in entry:
377 - noise.corruption(x,"missing _eclasses_ field")
378 - continue
379 - if not eclass_cache.is_eclass_data_valid(entry["_eclasses_"]):
380 - noise.eclass_stale(x)
381 - continue
382 - else:
383 - entry["_eclasses_"] = eclass_cache.get_eclass_data(entry["INHERITED"].split(), \
384 - from_master_only=True)
385 - if not entry["_eclasses_"]:
386 - noise.eclass_stale(x)
387 - continue
388 + if src_cache.complete_eclass_entries and eclasses is None:
389 + noise.corruption(x, "missing _eclasses_ field")
390 + continue
391
392 + # Even if _eclasses_ already exists, replace it with data from
393 + # eclass_cache, in order to insert local eclass paths.
394 + eclasses = eclass_cache.get_eclass_data(inherited,
395 + from_master_only=True)
396 + if eclasses is None:
397 + noise.eclass_stale(x)
398 + continue
399 + entry["_eclasses_"] = eclasses
400 +
401 # by this time, if it reaches here, the eclass has been validated, and the entry has
402 # been updated/translated (if needs be, for metadata/cache mainly)
403 try: trg_cache[x] = entry
404
405 Modified: main/branches/prefix/pym/portage/eclass_cache.py
406 ===================================================================
407 --- main/branches/prefix/pym/portage/eclass_cache.py 2008-11-22 11:29:10 UTC (rev 12036)
408 +++ main/branches/prefix/pym/portage/eclass_cache.py 2008-11-22 11:31:14 UTC (rev 12037)
409 @@ -3,6 +3,8 @@
410 # License: GPL2
411 # $Id$
412
413 +__all__ = ["cache"]
414 +
415 from portage.util import normalize_path, writemsg
416 import errno, os, sys
417 from portage.data import portage_gid
418 @@ -63,14 +65,22 @@
419 except OSError:
420 continue
421 ys=y[:-eclass_len]
422 - self.eclasses[ys] = (x, long(mtime))
423 - self._eclass_locations[ys] = x
424 if x == self._master_eclass_root:
425 master_eclasses[ys] = mtime
426 - else:
427 - master_mtime = master_eclasses.get(ys)
428 - if master_mtime and master_mtime != mtime:
429 + self.eclasses[ys] = (x, mtime)
430 + self._eclass_locations[ys] = x
431 + continue
432 +
433 + master_mtime = master_eclasses.get(ys)
434 + if master_mtime is not None:
435 + if master_mtime == mtime:
436 + # It appears to be identical to the master,
437 + # so prefer the master entry.
438 + continue
439 + else:
440 self._master_eclasses_overridden[ys] = x
441 + self.eclasses[ys] = (x, mtime)
442 + self._eclass_locations[ys] = x
443
444 def is_eclass_data_valid(self, ec_dict):
445 if not isinstance(ec_dict, dict):