Merged from trunk 8175:8186
authorFabian Groffen <grobian@gentoo.org>
Sun, 21 Oct 2007 12:31:53 +0000 (12:31 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 21 Oct 2007 12:31:53 +0000 (12:31 -0000)
   | 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

man/emerge.1
man/make.conf.5
pym/_emerge/__init__.py
pym/_emerge/help.py
pym/portage/dbapi/vartree.py
pym/portage/elog/__init__.py
pym/portage/elog/messages.py
pym/portage/elog/mod_echo.py

index 74bbe420f0fe2cc502a214f1bd6c1319c6789253..bf664e0c541dd538f2404a732c7d6dfd2439e486 100644 (file)
@@ -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),
index f0b81b5e80c60e81dfb742f95fb4c1f657acf818..bea1f9ef203c241d8e33e113ff2d5b6c2866467f 100644 (file)
@@ -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.
index 71bac634671d13658fbabc5c72582d3cf6bb916e..e52ac45a1a45bb7497d25b439a0bd814040203a1 100644 (file)
@@ -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
 
index 5bb93a1f4896f30649f5cfce8104ad26d2dc4069..4c7505da170d5011dca6abc21a68a73534a16ab6 100644 (file)
@@ -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"
index e66e76672f6e1a931ab471a19e430098b09bde03..8c3af39bcb8b417f5fb3b672e98e5c9559c6ee7d 100644 (file)
@@ -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
index ef040faa938ce06e3d0ba6cd18b1a447ccdab64e..e1df6d9bd3c2f0d8ac8630316a6d89304f7e1a97 100644 (file)
@@ -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
index 7c860729bea0beec0783d39496390a7d508043ef..c86d67b02a1adc61d409f71b4c566fa0eb248683 100644 (file)
@@ -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):
index 6a12c036495936be1c3d48f8ccd804b76a6018bc..30d88f005067224f973864f68af17a8231bd7747 100644 (file)
@@ -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 = []