Merged from trunk 8900:8937
authorFabian Groffen <grobian@gentoo.org>
Mon, 17 Dec 2007 18:28:23 +0000 (18:28 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 17 Dec 2007 18:28:23 +0000 (18:28 -0000)
   | 8901    | Make portdbapi.visible() mask ebuilds that do not define     |
   | zmedico | SLOT. (branches/2.1.2 r8900)                                 |

   | 8904    | Use the BAD color class instead of hardcoded red.            |
   | zmedico |                                                              |

   | 8906    | Properly filter SANDBOX_ON from the environment. When        |
   | zmedico | sourcing ${T}/environment it's a bit tricky because we have  |
   |         | to temporarily disable sandbox since the                     |
   |         | SANDBOX_{DENY,READ,PREDICT,_WRITE} values we've just loaded  |
   |         | may be unusable (triggering in spurious sandbox violations)  |
   |         | until we've merged them with our current values.             |

   | 8907    | Remove extra _ typo.                                         |
   | zmedico |                                                              |

   | 8909    | Allow FEATURES to persist between phases since the user      |
   | zmedico | might want to modify it via bashrc to enable things like     |
   |         | splitdebug and installsources for specific packages. They    |
   |         | should be able to modify it in pre_pkg_setup() and have it   |
   |         | persist all the way through the install phase. However, if   |
   |         | FEATURES exist inside environment.bz2 then they should be    |
   |         | overridden by current settings.                              |

   | 8911    | Make sure that PORTAGE_SANDBOX_* variables can never be set  |
   | zmedico | by "${T}"/environment.                                       |

   | 8913    | Bug #202126 - Replace an obsolete reference to `emerge       |
   | zmedico | --help config` with a reference to the CONFIGURATION FILES   |
   |         | section of emerge(1).                                        |

   | 8915    | Disable the "QA Notice: Pre-stripped files" message when     |
   | zmedico | RESTRICT contains "strip" or "binchecks". This is needed at  |
   |         | least for the glibc ebuild since it calls prepallstrip       |
   |         | directly, resulting in it being called twice. Thanks to      |
   |         | loki_val for reporting.                                      |

   | 8917    | Add --buildpkgonly to the options lists that exempt from     |
   | zmedico | slot collisions and world file updates.                      |

   | 8920    | Add support for multi-line commit message input by using EOF |
   | zmedico | as a delimiter (Ctrl-d) instead of a new line.               |

   | 8921    | Add support for getting a commit message using an editor     |
   | zmedico | defined by the EDITOR environment variable.                  |

   | 8923    | Prompt the user before letting the editor take over the      |
   | zmedico | screen so there is an opportunity to review any QA warnings. |

   | 8925    | Save QA output so that it can be conveniently displayed in   |
   | zmedico | $EDITOR while the user creates a commit message. Otherwise,  |
   |         | the user would not be able to see this output once the       |
   |         | editor has taken over the screen. Output is done through a   |
   |         | formatter object where it is captured for later use. A       |
   |         | file-like object that behaves something like the             |
   |         | portage.output.colorize() function is used to transfor style |
   |         | identifiers from the formatter framework into actual console |
   |         | codes.                                                       |

   | 8927    | Replace hardcoded green, yellow, and red with GOOD, WARN,    |
   | zmedico | and BAD.                                                     |

   | 8928    | Instead of all modes, only in commit mode save an extra copy |
   | zmedico | of QA output for display in $EDITOR.                         |

   | 8930    | Split out a format_qa_output() function to eliminate         |
   | zmedico | duplicate code.                                              |

   | 8932    | Fix punctuation and spelling. Thanks to Arfrever Frehtes     |
   | zmedico | Taifersar Arahesis <arfrever.fta@gmail.com>.                 |

   | 8934    | Move the reusable ConsoleStyleFile and StyleWriter classes   |
   | zmedico | into the ouput module.                                       |

   | 8935    | In "QA Notice: Precompiled python" messages, use sed to      |
   | zmedico | strip the leading ${D} from file paths.                      |

   | 8937    | Fix setconfig.getSets() api breakage.                        |
   | zmedico |                                                              |

svn path=/main/branches/prefix/; revision=8940

12 files changed:
bin/ebuild.sh
bin/emaint
bin/isolated-functions.sh
bin/misc-functions.sh
bin/prepstrip
bin/repoman
doc/config/sets.docbook
doc/qa.docbook
man/make.conf.5
pym/_emerge/__init__.py
pym/portage/dbapi/porttree.py
pym/portage/output.py

index ffd497192196cc8427aae5aa60e829544bb97289..9e9c139e7d72a60d77737e2053566e4fa068ba69 100755 (executable)
@@ -1408,6 +1408,14 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
 # is only desired in certain cases, such as during preprocessing or when
 # saving environment.bz2 for a binary or installed package.
 #
+# --filter-features causes the special FEATURES variable to be filtered.
+# Generally, we want it to persist between phases since the user might
+# want to modify it via bashrc to enable things like splitdebug and
+# installsources for specific packages. They should be able to modify it
+# in pre_pkg_setup() and have it persist all the way through the install
+# phase. However, if FEATURES exist inside environment.bz2 then they
+# should be overridden by current settings.
+#
 # ---allow-extra-vars causes some extra vars to be allowd through, such
 # as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
 #
@@ -1421,7 +1429,7 @@ filter_readonly_variables() {
                PIPESTATUS PPID SHELLOPTS UID"
        local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
                SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-               SANDBOX_LOG"
+               SANDBOX_LOG SANDBOX_ON"
        filtered_vars="${readonly_bash_vars} ${READONLY_PORTAGE_VARS}
                BASH_[_[:alnum:]]*"
        if hasq --filter-sandbox $* ; then
@@ -1429,6 +1437,9 @@ filter_readonly_variables() {
        else
                filtered_vars="${filtered_vars} ${filtered_sandbox_vars}"
        fi
+       if hasq --filter-features $* ; then
+               filtered_vars="${filtered_vars} FEATURES"
+       fi
        if ! hasq --allow-extra-vars $* ; then
                filtered_vars="
                        ${filtered_vars}
@@ -1464,9 +1475,9 @@ preprocess_ebuild_env() {
        if [ -f "${T}/environment.raw" ] ; then
                # This is a signal from the python side, indicating that the
                # environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
-               # variables that should be filtered out. Between phases, these
-               # variables are normally preserved.
-               filter_opts="--filter-sandbox ${filter_opts}"
+               # and FEATURES variables that should be filtered out. Between
+               # phases, these variables are normally preserved.
+               filter_opts="--filter-sandbox --filter-features ${filter_opts}"
        fi
        filter_readonly_variables ${filter_opts} < "${T}"/environment \
                > "${T}"/environment.filtered || return $?
@@ -1478,7 +1489,13 @@ preprocess_ebuild_env() {
        # called. Any variables that need to be relied upon should already be
        # filtered out above.
        (
+               export SANDBOX_ON=1
                source "${T}/environment" || exit $?
+               # We have to temporarily disable sandbox since the
+               # SANDBOX_{DENY,READ,PREDICT,WRITE} values we've just loaded
+               # may be unusable (triggering in spurious sandbox violations)
+               # until we've merged them with our current values.
+               export SANDBOX_ON=0
 
                # It's remotely possible that save_ebuild_env() has been overridden
                # by the above source command. To protect ourselves, we override it
@@ -1617,8 +1634,15 @@ elif ! hasq ${EBUILD_PHASE} depend && [ -f "${T}"/environment ] ; then
        for x in SANDBOX_DENY SANDBOX_READ SANDBOX_PREDICT SANDBOX_WRITE ; do
                eval PORTAGE_${x}=\${!x}
        done
+       PORTAGE_SANDBOX_ON=${SANDBOX_ON}
+       export SANDBOX_ON=1
        source "${T}"/environment || \
                die "error sourcing environment"
+       # We have to temporarily disable sandbox since the
+       # SANDBOX_{DENY,READ,PREDICT,WRITE} values we've just loaded
+       # may be unusable (triggering in spurious sandbox violations)
+       # until we've merged them with our current values.
+       export SANDBOX_ON=0
        for x in SANDBOX_DENY SANDBOX_PREDICT SANDBOX_READ SANDBOX_WRITE ; do
                eval y=\${PORTAGE_${x}}
                if [ "${y}" != "${!x}" ] ; then
@@ -1628,6 +1652,8 @@ elif ! hasq ${EBUILD_PHASE} depend && [ -f "${T}"/environment ] ; then
                unset PORTAGE_${x}
        done
        unset x y
+       export SANDBOX_ON=${PORTAGE_SANDBOX_ON}
+       unset PORTAGE_SANDBOX_ON
        source_all_bashrcs
 else
 
index 157bea8055531f0783536ae3a20e721072dd5698..2eaa3cf0b689d9ec51166941029c0a06d9f67653 100755 (executable)
@@ -26,7 +26,7 @@ class WorldHandler(object):
                from portage.sets import load_default_config
                setconfig = load_default_config(portage.settings,
                        portage.db[portage.settings["ROOT"]])
-               self._sets = setconfig.getSetsWithAliases()
+               self._sets = setconfig.getSets()
 
        def _check_world(self, onProgress):
                categories = set(portage.settings.categories)
index b69bc35526c1f2bb016a3a13e2712db9d9b8bb41..60bbabb71288bf473ee61a02874956630c43f002 100755 (executable)
@@ -437,7 +437,7 @@ save_ebuild_env() {
                unset BAD BRACKET BUILD_PREFIX COLS \
                        DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \
                        EBUILD_EXIT_STATUS_FILE EBUILD_MASTER_PID \
-                       ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY FEATURES \
+                       ECLASSDIR ECLASS_DEPTH ENDCOL FAKEROOTKEY \
                        GOOD HILITE HOME IMAGE \
                        LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \
                        NORMAL PATH PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \
@@ -447,7 +447,7 @@ save_ebuild_env() {
                        PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \
                        PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \
                        PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_WORKDIR_MODE PORTDIR \
-                       PORTDIR_OVERLAY PREROOTPATH \
+                       PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \
                        PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \
                        RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \
                        RC_INDENTATION READONLY_EBUILD_METADATA READONLY_PORTAGE_VARS \
index 7255f8d285761c020bc2b6f576a16a2e798fbd82..1975c418c287d233996c2c468fa64c8730103c0e 100644 (file)
@@ -407,7 +407,8 @@ install_qa_check() {
 
        # Compiled python objects do not belong in /usr/share (FHS violation)
        # and can be a pain when upgrading python
-       f=$([ -d "${ED}"/usr/share ] && find "${ED}"/usr/share -name '*.py[co]')
+       f=$([ -d "${ED}"/usr/share ] && \
+               find "${ED}"usr/share -name '*.py[co]' | sed "s:${D}:/:")
        if [[ -n ${f} ]] ; then
                vecho -ne '\a\n'
                eqawarn "QA Notice: Precompiled python object files do not belong in /usr/share"
index 86850cc872771ae98178a3adeb81f3dae3acc33a..2ccf84c991db4a539a4b5ee9a1a3ff312df1f6bf 100755 (executable)
@@ -1,7 +1,7 @@
 #!@BASH@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id:$
+# $Id$
 
 source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
 
@@ -66,12 +66,15 @@ save_elf_debug() {
 # The existance of the section .symtab tells us that a binary is stripped.
 # We want to log already stripped binaries, as this may be a QA violation.
 # They prevent us from getting the splitdebug data.
-f=$(scanelf -yqRBF '#k%F' -k '!.symtab' "$@")
-if [[ -n ${f} ]] ; then
-       vecho -e "\a\n"
-       eqawarn "QA Notice: Pre-stripped files found:"
-       eqawarn "${f}"
-       echo "${f}" > "${T}"/scanelf-already-stripped.log
+if ! hasq binchecks ${RESTRICT} && \
+       ! hasq strip ${RESTRICT} ; then
+       f=$(scanelf -yqRBF '#k%F' -k '!.symtab' "$@")
+       if [[ -n ${f} ]] ; then
+               vecho -e "\a\n"
+               eqawarn "QA Notice: Pre-stripped files found:"
+               eqawarn "${f}"
+               echo "${f}" > "${T}"/scanelf-already-stripped.log
+       fi
 fi
 
 # Now we look for unstripped binaries.
index 81d71c866ad6e002dda7a5973161a3681a640d04..3d2c1df7e25ccd74cd427f118c8ba291e0ad4c3b 100755 (executable)
@@ -9,6 +9,7 @@
 
 import codecs
 import errno
+import formatter
 import logging
 import optparse
 import os
@@ -31,6 +32,11 @@ try:
 except ImportError:
        import pickle
 
+try:
+       import cStringIO as StringIO
+except ImportError:
+       import StringIO
+
 if not hasattr(__builtins__, "set"):
        from sets import Set as set
 
@@ -62,6 +68,7 @@ from portage.process import find_binary, spawn
 from portage.util import initialize_logger
 from portage.output import bold, create_color_func, darkgreen, \
        green, nocolor, red, turquoise, yellow
+from portage.output import ConsoleStyleFile, StyleWriter
 
 initialize_logger()
 
@@ -342,6 +349,107 @@ valid_restrict = frozenset(["binchecks", "bindist", "fetch", "mirror",
 # file.executable
 no_exec = frozenset(["Manifest","ChangeLog","metadata.xml"])
 
+def editor_is_executable(editor):
+       """
+       Given an EDITOR string, validate that it refers to
+       an executable. This uses shlex.split() to split the
+       first component and do a PATH lookup if necessary.
+
+       @param editor: An EDITOR value from the environment.
+       @type: string
+       @rtype: bool
+       @returns: True if an executable is found, False otherwise.
+       """
+       import shlex
+       editor_split = shlex.split(editor)
+       if not editor_split:
+               return False
+       filename = editor_split[0]
+       if not os.path.isabs(filename):
+               from portage.process import find_binary
+               return find_binary(filename) is not None
+       return os.access(filename, os.X_OK) and os.path.isfile(filename)
+
+def get_commit_message_with_editor(editor, message=None):
+       """
+       Execute editor with a temporary file as it's argument
+       and return the file content afterwards.
+
+       @param editor: An EDITOR value from the environment
+       @type: string
+       @param message: An iterable of lines to show in the editor.
+       @type: iterable
+       @rtype: string or None
+       @returns: A string on success or None if an error occurs.
+       """
+       from tempfile import mkstemp
+       fd, filename = mkstemp()
+       try:
+               os.write(fd, "\n# Please enter the commit message " + \
+                       "for your changes.\n# (Comment lines starting " + \
+                       "with '#' will not be included)\n")
+               if message:
+                       os.write(fd, "#\n")
+                       for line in message:
+                               os.write(fd, "#" + line)
+               os.close(fd)
+               retval = os.system(editor + " '%s'" % filename)
+               if not (os.WIFEXITED(retval) and os.WEXITSTATUS(retval) == os.EX_OK):
+                       return None
+               try:
+                       mylines = open(filename).readlines()
+               except OSError, e:
+                       if e.errno != errno.ENOENT:
+                               raise
+                       del e
+                       return None
+               return "".join(line for line in mylines if not line.startswith("#"))
+       finally:
+               try:
+                       os.unlink(filename)
+               except OSError:
+                       pass
+
+def get_commit_message_with_stdin():
+       """
+       Read a commit message from the user and return it.
+
+       @rtype: string or None
+       @returns: A string on success or None if an error occurs.
+       """
+       print "Please enter a commit message. Use Ctrl-d to finish or Ctrl-c to abort."
+       commitmessage = []
+       while True:
+               commitmessage.append(sys.stdin.readline())
+               if not commitmessage[-1]:
+                       break
+       commitmessage = "".join(commitmessage)
+       return commitmessage
+
+def format_qa_output(f, stats, fails, dofull, dofail):
+       full = options.mode in ("full", "lfull")
+       for x in qacats:
+               if not stats[x]:
+                       continue
+               f.add_literal_data("  " + x.ljust(30))
+               if x in qawarnings:
+                       f.push_style("WARN")
+               else:
+                       f.push_style("BAD")
+               f.add_literal_data(str(stats[x]))
+               f.pop_style()
+               f.add_line_break()
+               if not dofull:
+                       if not full and dofail and x in qawarnings:
+                               # warnings are considered noise when there are failures
+                               continue
+                       fails_list = fails[x]
+                       if not full and len(fails_list) > 12:
+                               fails_list = fails_list[:12]
+                       for y in fails_list:
+                               f.add_literal_data("   "+y)
+                               f.add_line_break()
+
 def last(full=False):
        """Print the results of the last repoman run
        Args:
@@ -364,33 +472,26 @@ def last(full=False):
        #dofull will be set if we should print a "repoman full" informational message
        dofull=0
 
-       print
-       print green("RepoMan remembers...")
-       print
+       dofull = options.mode not in ("full", "lfull")
+       
        for x in qacats:
-               if stats[x]:
-                       dowarn=1
-                       if x not in qawarnings:
-                               dofail=1
-               else:
+               if not stats[x]:
                        continue
-               print "  "+ x.ljust(20),
-               if stats[x]==0:
-                       print green(`stats[x]`)
+               if "notadded" in x and not isCvs:
+                       stats[x] = 0
                        continue
-               elif x in qawarnings:
-                       print yellow(`stats[x]`)
-               else:
-                       print red(`stats[x]`)
-               if not full:
-                       if stats[x]<12:
-                               for y in fails[x]:
-                                       print "   "+y
-                       else:
-                               dofull=1
-               else:
-                       for y in fails[x]:
-                               print "   "+y
+               dowarn = 1
+               if x not in qawarnings:
+                       dofail = 1
+
+       print
+       print green("RepoMan remembers...")
+       print
+       style_file = ConsoleStyleFile(sys.stdout)
+       console_writer = StyleWriter(file=style_file, maxcol=9999)
+       console_writer.style_listener = style_file.new_styles
+       f = formatter.AbstractFormatter(console_writer)
+       format_qa_output(f, stats, fails, dofull, dofail)
        print
        if dofull:
                print bold("Note: type \"repoman lfull\" for a complete listing of repomans last run.")
@@ -432,7 +533,7 @@ if isCvs or isSvn and \
                "pycrypto or enable python's ssl USE flag in order " \
                "to enable RMD160 hash support. See bug #198398 for " \
                "more information."
-               prefix = red(" * ")
+               prefix = bad(" * ")
                from textwrap import wrap
                for line in wrap(msg, 70):
                        print prefix + line
@@ -1603,33 +1704,42 @@ dofail=0
 #dowarn will be set to 1 if we tripped any warnings
 dowarn=0
 #dofull will be set if we should print a "repoman full" informational message
-dofull=0
+dofull = options.mode not in ("full", "lfull")
+
 for x in qacats:
-       if not isCvs and not isSvn and (x.find("notadded") != -1):
-               stats[x] = 0
-       if stats[x]:
-               dowarn=1
-               if x not in qawarnings:
-                       dofail=1
-       else:
+       if not stats[x]:
                continue
-       print "  "+x.ljust(30),
-       if stats[x]==0:
-               print green(`stats[x]`)
+       if "notadded" in x and not isCvs and not isSvn:
+               stats[x] = 0
                continue
-       elif x in qawarnings:
-               print yellow(`stats[x]`)
-       else:
-               print red(`stats[x]`)
-       if options.mode !="full":
-               if stats[x]<12:
-                       for y in fails[x]:
-                               print "   "+y
-               else:
-                       dofull=1
-       else:
-               for y in fails[x]:
-                       print "   "+y
+       dowarn = 1
+       if x not in qawarnings:
+               dofail = 1
+
+if dofail or \
+       (dowarn and not (options.quiet or options.mode == "scan")):
+       dofull = 0
+
+# Save QA output so that it can be conveniently displayed
+# in $EDITOR while the user creates a commit message.
+# Otherwise, the user would not be able to see this output
+# once the editor has taken over the screen.
+qa_output = StringIO.StringIO()
+style_file = ConsoleStyleFile(sys.stdout)
+if options.mode == 'commit' and \
+       (not commitmessage or not commitmessage.strip()):
+       style_file.write_listener = qa_output
+console_writer = StyleWriter(file=style_file, maxcol=9999)
+console_writer.style_listener = style_file.new_styles
+
+f = formatter.AbstractFormatter(console_writer)
+
+format_qa_output(f, stats, fails, dofull, dofail)
+
+style_file.flush()
+del console_writer, f, style_file
+qa_output = qa_output.getvalue()
+qa_output = qa_output.splitlines(True)
 
 def grouplist(mylist,seperator="/"):
        """(list,seperator="/") -- Takes a list of elements; groups them into
@@ -1819,13 +1929,20 @@ else:
                                raise
                # We've read the content so the file is no longer needed.
                commitmessagefile = None
-       if not commitmessage:
-               print "Please enter a CVS commit message at the prompt:"
-               while not commitmessage:
-                       try:
-                               commitmessage=raw_input(green("> "))
-                       except KeyboardInterrupt: 
-                               exithandler()
+       if not commitmessage or not commitmessage.strip():
+               try:
+                       editor = os.environ.get("EDITOR")
+                       if editor and editor_is_executable(editor):
+                               commitmessage = get_commit_message_with_editor(
+                                       editor, message=qa_output)
+                       else:
+                               commitmessage = get_commit_message_with_stdin()
+               except KeyboardInterrupt:
+                       exithandler()
+               if not commitmessage or not commitmessage.strip():
+                       print "* no commit message?  aborting commit."
+                       sys.exit(1)
+       commitmessage = commitmessage.rstrip()
        portage_version = getattr(portage, "VERSION", None)
        if portage_version is None:
                sys.stderr.write("Failed to insert portage version in message!\n")
index ff06a7bc799c38054bbecd372645bc3fad15dd5d..c7fc37c21696acc0b3335837960a567babaa8f64 100644 (file)
@@ -17,7 +17,7 @@
                <!-- TODO: Add reference to currently non-existing documentation about
                set usage and default sets -->
                After that it will read repository specific configurations from 
-               <envar>PORTDIR</envar> and <envar>PORTDIR_OVERLAY</envar>that might
+               <envar>PORTDIR</envar> and <envar>PORTDIR_OVERLAY</envar> that might
                include definitions of sets included in the repository.
                Finally a system-specific set configuration may reside in 
                <filename>/etc/portage</filename> to either define additional sets or
@@ -30,7 +30,7 @@
                <para>
                Unlike other Portage configuration files <filename>sets.conf</filename> 
                uses Pythons <classname>ConfigParser</classname> module, which implements
-               the syntax usually found in .ini files. At it's core it allows various
+               the syntax usually found in .ini files. At its core it allows various
                named sections that each can contain any number of key-value pairs, see
                the <ulink url="http://doc.python.org/lib/module-ConfigParser.html" type="text/html">Python documentation</ulink>
                for the full details.
@@ -47,7 +47,7 @@
                        it only requires a single option <varname>class</varname> to be 
                        complete <footnote><para>Technically the <varname>class</varname> option
                        isn't stricly required, but it should always be used as the default 
-                       handler might be changed in future versions</para></footnote>.
+                       handler might be changed in future versions.</para></footnote>.
                        That option defines which handler class should be used to 
                        create the set. Another universal option available for single sets is
                        <varname>name</varname>, however it's usually not needed as the name
                <title>portage.sets.security.NewAffectedSet</title>
                <para>
                Like <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>,
-               but ignores all GLSAs that were already applied or inejcted previously,
+               but ignores all GLSAs that were already applied or injected previously,
                and all GLSAs that don't affect the current system. Practically there
                should be no difference to <classname>NewGlsaSet</classname> though.
                </para>
                        <listitem><varname>only_visible</varname>: Optional, defaults to <parameter>true</parameter>.
                                When set to <parameter>true</parameter> the set will only include visible packages, 
                                when set to <parameter>false</parameter> it will also include masked packages.
-                               It's currently only effective in in combination with the <parameter>porttree</parameter>
+                               It's currently only effective in combination with the <parameter>porttree</parameter>
                                repository.
                        </listitem>
                        </itemizedlist>
index cb9b242d647bf1f6420f0f800e5bbf0db97bcd97..6f0d45dc23e40ab914faf4c78e46af954b97ba48 100644 (file)
     </listitem>
     <listitem>
      <para>Perl - some versions of perl would use incorrect -rpath flags</para>
-     <para>Solution: upgrade system perl build modules</para>
+     <para>Solution: Upgrade system perl build modules</para>
     </listitem>
     <listitem>
      <para>Crappy build system - the custom build system uses -rpath incorrectly</para>
-     <para>Solution: review the LDFLAGS in the build system and make them not suck</para>
+     <para>Solution: Review the LDFLAGS in the build system and make them not suck</para>
     </listitem>
     <listitem>
      <para>Crappy ebuild - the ebuild installs ELFs instead of using the package's build system</para>
-     <para>Solution: fix the crappy ebuild to use the package's build system</para>
+     <para>Solution: Fix the crappy ebuild to use the package's build system</para>
     </listitem>
    </itemizedlist>
   </para>
index b628a741b651f1220c80a2d74c859d6160ceddde..871c01bc5ba4fffafc0c5c5753533d4c9a226b19 100644 (file)
@@ -85,11 +85,13 @@ files and/or directories.
 .TP
 \fBCONFIG_PROTECT\fR = \fI[space delimited list of files and/or directories]\fR
 All files and/or directories that are defined here will have "config file protection"
-enabled for them.  For more information, please see `emerge \-\-help config`.
+enabled for them. See the \fBCONFIGURATION FILES\fR section
+of \fBemerge\fR(1) for more information.
 .TP
 \fBCONFIG_PROTECT_MASK\fR = \fI[space delimited list of files and/or directories]\fR
 All files and/or directories that are defined here will have "config file protection"
-disabled for them.  For more information, please see `emerge \-\-help config`.
+disabled for them. See the \fBCONFIGURATION FILES\fR section
+of \fBemerge\fR(1) for more information.
 .TP
 .B CTARGET
 This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR
index 87514ab5157cbce5a09d4be734b56ee0c120047e..e3dc277effa74a5e208b7dc1e1a23360a15ee987 100644 (file)
@@ -2811,7 +2811,8 @@ class depgraph(object):
 
        def _accept_collisions(self):
                acceptable = False
-               for x in ("--nodeps", "--pretend", "--fetchonly", "--fetch-all-uri"):
+               for x in ("--buildpkgonly", "--fetchonly",
+                       "--fetch-all-uri", "--nodeps", "--pretend"):
                        if x in self.myopts:
                                acceptable = True
                                break
@@ -3872,7 +3873,7 @@ class depgraph(object):
        def saveNomergeFavorites(self):
                """Find atoms in favorites that are not in the mergelist and add them
                to the world file if necessary."""
-               for x in ("--fetchonly", "--fetch-all-uri",
+               for x in ("--buildpkgonly", "--fetchonly", "--fetch-all-uri",
                        "--oneshot", "--onlydeps", "--pretend"):
                        if x in self.myopts:
                                return
@@ -6613,7 +6614,7 @@ def action_build(settings, trees, mtimedb,
                                        "with another package; the two packages cannot " + \
                                        "be installed on the same system together. " + \
                                        "Please use 'emerge --pretend' to determine blockers."
-                                       prefix = red(" * ")
+                                       prefix = bad(" * ")
                                        from textwrap import wrap
                                        for line in wrap(msg, 70):
                                                print prefix + line
index db2b35aff6aa7af8a60af8d95e9ff37d36254ad0..0ed55fba858fe55474f713fbf821b91ee2d1c6eb 100644 (file)
@@ -701,6 +701,8 @@ class portdbapi(dbapi):
                        except KeyError:
                                # masked by corruption
                                continue
+                       if not metadata["SLOT"]:
+                               continue
                        if getMaskAtom(cpv, metadata):
                                continue
                        if getProfileMaskAtom(cpv, metadata):
index 9eae2ee87bb9e3a3ae92bc1ec5ed9b30da728063..148fddd0fdb7d09b60fd4061caec399bb0815c80 100644 (file)
@@ -6,6 +6,7 @@ __docformat__ = "epytext"
 
 import commands
 import errno
+import formatter
 import os
 import re
 import shlex
@@ -314,6 +315,57 @@ def create_color_func(color_key):
 for c in compat_functions_colors:
        globals()[c] = create_color_func(c)
 
+class ConsoleStyleFile(object):
+       """
+       A file-like object that behaves something like
+       the colorize() function. Style identifiers
+       passed in via the new_styles() method will be used to
+       apply console codes to output.
+       """
+       def __init__(self, f):
+               self._file = f
+               self._styles = None
+               self.write_listener = None
+
+       def new_styles(self, styles):
+               self._styles = styles
+
+       def write(self, s):
+               if self._styles:
+                       for style in self._styles:
+                               self._file.write(codes[style])
+                       self._file.write(s)
+                       self._file.write(codes["reset"])
+               else:
+                       self._file.write(s)
+               if self.write_listener:
+                       self.write_listener.write(s)
+
+       def writelines(self, lines):
+               for s in lines:
+                       self.write(s)
+
+       def flush(self):
+               self._file.flush()
+
+       def close(self):
+               self._file.close()
+
+class StyleWriter(formatter.DumbWriter):
+       """
+       This is just a DumbWriter with a hook in the new_styles() method
+       that passes a styles tuple as a single argument to a callable
+       style_listener attribute.
+       """
+       def __init__(self, **kwargs):
+               formatter.DumbWriter.__init__(self, **kwargs)
+               self.style_listener = None
+
+       def new_styles(self, styles):
+               formatter.DumbWriter.new_styles(self, styles)
+               if self.style_listener:
+                       self.style_listener(styles)
+
 def get_term_size():
        """
        Get the number of lines and columns of the tty that is connected to