From: Fabian Groffen Date: Sun, 21 Oct 2007 12:31:53 +0000 (-0000) Subject: Merged from trunk 8175:8186 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=356b23fd4e12d08337d9103fbb21f043fd21d937;p=portage.git Merged from trunk 8175:8186 | 8176 | Use the python version of eerror | | genone | | | 8177 | The ERROR color code is currently undefined, so make eerror | | zmedico | use BAD like the bash version does. | | 8178 | Pass the whole cpv to elog instead of just ${PF}. | | zmedico | | | 8179 | Bug #196427 - Don't display news notifications when in | | zmedico | --pretend mode. | | 8180 | Don't show each character of the log message on a new line | | zmedico | when displaying messages that came from one of the | | | python-based elog functions. This might not be the correct | | | solution but it seems to work for now. | | 8181 | Fix broken call to renamed _combine_logentries(). | | zmedico | | | 8182 | Prevent _combine_logentries() from generating redundant | | zmedico | consecutive 'TYPE: phase' lines that show in summary.log | | | when the python-based elog functions are used. | | 8183 | Use a list to buffer strings in _combine_logentries() and do | | zmedico | a single concatenation at the end for better efficiency. | | 8184 | Refactor _merge_logentries() to make it a little more | | zmedico | efficient. | | 8185 | Bug #196435 - Add some more references to quickpkg(1) since | | zmedico | sometimes people don't realize that it exists. | | 8186 | Remove the config.setinst() call from depgraph.select_dep() | | zmedico | since it's never really guaranteed to work as intended. It's | | | supposed to help ensure that the correct old-style virtual | | | is preferred but it will often fail to do so, making it | | | necessary for the user to manually force the preference. | | | Proper backtracking (bug #1343) will solve the problem more | | | reliably. | svn path=/main/branches/prefix/; revision=8211 --- diff --git a/man/emerge.1 b/man/emerge.1 index 74bbe420f..bf664e0c5 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -222,9 +222,10 @@ buffer is not cleared prior to the prompt, so an accidental press of the Tells emerge to build binary packages for all ebuilds processed in addition to actually merging the packages. Useful for maintainers or if you administrate multiple Gentoo Linux systems (build once, -emerge tbz2s everywhere). The package will be created in the +emerge tbz2s everywhere) as well as disaster recovery. The package +will be created in the \fI${PKGDIR}/All\fR directory. An alternative for already\-merged -packages is to use \fBquickpkg\fR which creates a tbz2 from the +packages is to use \fBquickpkg\fR(1) which creates a tbz2 from the live filesystem. .TP .BR "\-\-buildpkgonly " (\fB\-B\fR) @@ -664,6 +665,7 @@ Contains the default variables for the build process. \fBDo not edit this file\fR. .SH "SEE ALSO" .BR "emerge \-\-help", +.BR quickpkg (1), .BR ebuild (1), .BR ebuild (5), .BR make.conf (5), diff --git a/man/make.conf.5 b/man/make.conf.5 index f0b81b5e8..bea1f9ef2 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -143,7 +143,9 @@ not \fIassume\-digests\fR is enabled. The \fBebuild\fR(1) \fBdigest\fR command has a \fB\-\-force\fR option that can be used to force regeneration of digests. .TP .B buildpkg -Binary packages will be created for all packages that are merged. +Binary packages will be created for all packages that are merged. Also see +\fBquickpkg\fR(1) and \fBemerge\fR(1) \fB\-\-buildpkg\fR and +\fB\-\-buildpkgonly\fR options. .TP .B buildsyspkg Build binary packages for just packages in the system set. diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 71bac6346..e52ac45a1 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1847,34 +1847,6 @@ class depgraph(object): if depstring in self._set_atoms: self._pprovided_args.append((arg, depstring)) - if myparent: - # The parent is added after it's own dep_check call so that it - # isn't allowed to satisfy a direct bootstrap dependency on itself - # via an old-style virtual. This isn't a problem with new-style - # virtuals, which are preferenced in dep_zapdeps by looking only at - # the depstring, vdb, and available packages. - - p_type, p_root, p_key, p_status = myparent - if p_status == "merge": - # Update old-style virtuals if this package provides any. - # These are needed for dep_virtual calls inside dep_check. - p_db = self.mydbapi[p_root] # contains cached metadata - if myparent in self._slot_collision_nodes: - # The metadata isn't cached due to the slot collision. - p_db = self.trees[p_root][self.pkg_tree_map[p_type]].dbapi - try: - self.pkgsettings[p_root].setinst(p_key, p_db) - # For consistency, also update the global virtuals. - settings = self.roots[p_root].settings - settings.unlock() - settings.setinst(p_key, p_db) - settings.lock() - except portage.exception.InvalidDependString, e: - provide = p_db.aux_get(p_key, ["PROVIDE"])[0] - show_invalid_depstring_notice(myparent, provide, str(e)) - del e - return 0 - if "--debug" in self.myopts: print "Candidates:",mymerge for x in mymerge: @@ -6850,7 +6822,7 @@ def emerge_main(): display_news_notification(trees) retval = action_build(settings, trees, mtimedb, myopts, myaction, myfiles, spinner) - if "--pretend" in myopts: + if "--pretend" not in myopts: display_news_notification(trees) return retval diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py index 5bb93a1f4..4c7505da1 100644 --- a/pym/_emerge/help.py +++ b/pym/_emerge/help.py @@ -21,6 +21,11 @@ def shorthelp(): print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]" def help(myaction,myopts,havecolor=1): + # TODO: Implement a wrap() that accounts for console color escape codes. + from textwrap import wrap + desc_left_margin = 14 + desc_indent = desc_left_margin * " " + desc_width = 80 - desc_left_margin - 5 if not myaction and ("--verbose" not in myopts): shorthelp() print @@ -184,11 +189,16 @@ def help(myaction,myopts,havecolor=1): print " time prior to the prompt will be interpreted as a choice!" print print " "+green("--buildpkg")+" ("+green("-b")+" short option)" - print " Tell emerge to build binary packages for all ebuilds processed" - print " (in addition to actually merging the packages. Useful for" - print " maintainers or if you administrate multiple Gentoo Linux" - print " systems (build once, emerge tbz2s everywhere) as well as disaster" - print " recovery." + desc = "Tells emerge to build binary packages for all ebuilds processed in" + \ + " addition to actually merging the packages. Useful for maintainers" + \ + " or if you administrate multiple Gentoo Linux systems (build once," + \ + " emerge tbz2s everywhere) as well as disaster recovery. The package" + \ + " will be created in the" + \ + " ${PKGDIR}/All directory. An alternative for already-merged" + \ + " packages is to use quickpkg(1) which creates a tbz2 from the" + \ + " live filesystem." + for line in wrap(desc, desc_width): + print desc_indent + line print print " "+green("--buildpkgonly")+" ("+green("-B")+" short option)" print " Creates a binary package, but does not merge it to the" diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index e66e76672..8c3af39bc 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1768,13 +1768,10 @@ class dblink(object): self.settings, 0, 0, mydbapi) prepare_build_dirs(destroot, self.settings, cleanup) + from portage.elog.messages import eerror as _eerror def eerror(lines): - cmd = "source '%s/isolated-functions.sh' ; " % PORTAGE_BIN_PATH - for line in lines: - cmd += "eerror '%s' ; " % line - from portage import process - process.spawn(["bash", "-c", cmd], - env=self.settings.environ()) + for l in lines: + _eerror(l, phase="preinst", key=self.settings.mycpv) if collisions: collision_protect = "collision-protect" in self.settings.features diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py index ef040faa9..e1df6d9bd 100644 --- a/pym/portage/elog/__init__.py +++ b/pym/portage/elog/__init__.py @@ -18,27 +18,29 @@ def _merge_logentries(a, b): phases = set(a) phases.update(b) for p in phases: - rValue[p] = [] - if a.has_key(p): - for x in a[p]: - rValue[p].append(x) - if b.has_key(p): - for x in b[p]: - rValue[p].append(x) + merged_msgs = [] + rValue[p] = merged_msgs + for d in a, b: + msgs = d.get(p) + if msgs: + merged_msgs.extend(msgs) return rValue def _combine_logentries(logentries): # generate a single string with all log messages - rValue = "" + rValue = [] for phase in EBUILD_PHASES: if not phase in logentries: continue + previous_type = None for msgtype, msgcontent in logentries[phase]: - rValue += "%s: %s\n" % (msgtype, phase) + if previous_type != msgtype: + previous_type = msgtype + rValue.append("%s: %s\n" % (msgtype, phase)) for line in msgcontent: - rValue += line - rValue += "\n" - return rValue + rValue.append(line) + rValue.append("\n") + return "".join(rValue) _elog_atexit_handlers = [] _preserve_logentries = {} @@ -80,7 +82,7 @@ def elog_process(cpv, mysettings, phasefilter=None): s, levels = s.split(":", 1) levels = levels.split(",") mod_logentries = filter_loglevels(all_logentries[key], levels) - mod_fulllog = combine_logentries(mod_logentries) + mod_fulllog = _combine_logentries(mod_logentries) else: mod_logentries = default_logentries mod_fulllog = default_fulllog diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py index 7c860729b..c86d67b02 100644 --- a/pym/portage/elog/messages.py +++ b/pym/portage/elog/messages.py @@ -74,7 +74,7 @@ _functions = { "einfo": ("INFO", "GOOD"), "elog": ("LOG", "GOOD"), "ewarn": ("WARN", "WARN"), "eqawarn": ("QA", "WARN"), - "eerror": ("ERROR", "ERROR"), + "eerror": ("ERROR", "BAD"), } def _make_msgfunction(level, color): diff --git a/pym/portage/elog/mod_echo.py b/pym/portage/elog/mod_echo.py index 6a12c0364..30d88f005 100644 --- a/pym/portage/elog/mod_echo.py +++ b/pym/portage/elog/mod_echo.py @@ -34,6 +34,8 @@ def finalize(mysettings=None): "ERROR": printer.eerror, "LOG": printer.einfo, "QA": printer.ewarn} + if isinstance(msgcontent, basestring): + msgcontent = [msgcontent] for line in msgcontent: fmap[msgtype](line.strip("\n")) _items = []