Merged from trunk -r13874:13887
authorFabian Groffen <grobian@gentoo.org>
Tue, 4 Aug 2009 16:29:35 +0000 (16:29 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 4 Aug 2009 16:29:35 +0000 (16:29 -0000)
   | 13879    | Remove the code from bug #278895 since we're going to need  |
   | zmedico  | a daemon process in the ebuild's login session in order to  |
   |          | pass signals from the controlling terminal to the detached  |
   |          | session. A simple fifo-based approach in ebuild.sh does not |
   |          | seem to work since bash's read builtin occasionally loses   |
   |          | the fifo data when it's 'Interrupted system call'. Maybe a  |
   |          | python script will work better for the session              |
   |          | leader/daemon. NOTE: The daemon will also be useful for     |
   |          | implementing a fifo-based die helper (to replace the        |
   |          | current signal- based approach).                            |

   | 13880    | Bug #278729 - Add an Atom.without_use attribute which is    |
   | zmedico  | identical to the atom itself, except without any USE        |
   |          | dependencies.                                               |

   | 13881    | Bug #278729 - Inside dep_zapdeps(), ignore USE dependencies |
   | zmedico  | since we don't want USE settings to adversely affect ||     |
   |          | preference evaluation. Drop invalid atoms inside            |
   |          | _expand_new_virtuals() since we only want real Atom         |
   |          | instances inside dep_zapdeps().                             |

   | 13882    | Make the USE=test RDEPEND check (bug #236786) also apply to |
   | zmedico  | PDEPEND.                                                    |

   | 13883    | Fix NameError from r13880. Thanks to Arfrever for           |
   | zmedico  | reporting.                                                  |

   | 13884    | Add a PDEPEND.suspect category.                             |
   | zmedico  |                                                             |

   | 13887    | Set "emerge" xterm title at the beginning of running        |
   | arfrever | emerge.                                                     |

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

bin/ebuild.sh
bin/isolated-functions.sh
bin/repoman
bin/setsid [deleted file]
man/repoman.1
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/__init__.py
pym/portage/dep.py

index 150d98149eb41e2c232acbabea57654d4aa244c3..8f42772f0b1ac483581cba3769009da792f2c144 100755 (executable)
@@ -27,19 +27,6 @@ PREROOTPATH=${PREROOTPATH%%:}
 PATH="$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}:${ROOTPATH:+:}$ROOTPATH"
 export PATH
 
-if [[ -z $PORTAGE_SETSID && -n $1 && $1 != depend ]] ; then
-       # If available, use setsid to create a new login session so that we can use
-       # SIGHUP to ensure that no orphaned subprocesses are left running.
-       if type -P setsid >/dev/null ; then
-               export PORTAGE_SETSID=1
-               exec setsid "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
-       elif [[ -x $PORTAGE_BIN_PATH/setsid ]] ; then
-               export PORTAGE_SETSID=1
-               exec "$PORTAGE_BIN_PATH/setsid" "$PORTAGE_BIN_PATH/ebuild.sh" "$@"
-       fi
-fi
-[[ $PORTAGE_SETSID = 1 ]] && trap 'trap : SIGHUP ; kill -s SIGHUP 0 ;' EXIT
-
 # These two functions wrap sourcing and calling respectively.  At present they
 # perform a qa check to make sure eclasses and ebuilds and profiles don't mess
 # with shell opts (shopts).  Ebuilds/eclasses changing shopts should reset them 
index 947da3946ec6b40ecb614c592842bb5ddb67d4a7..20ab0f50feb88a9a1d21eb7059122409f878277c 100755 (executable)
@@ -538,8 +538,7 @@ save_ebuild_env() {
                        PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \
                        PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \
                        PORTAGE_QUIET \
-                       PORTAGE_REPO_NAME PORTAGE_RESTRICT \
-                       PORTAGE_SETSID PORTAGE_UPDATE_ENV \
+                       PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_UPDATE_ENV \
                        PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR \
                        PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \
                        PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \
index 2b67f44d6f3da19141b8b940f8b5bb3cd6bbf4ef..186d38407eccec672756f585738949d77ae49ddf 100755 (executable)
@@ -282,6 +282,7 @@ qahelp={
        "DEPEND.badmaskedindev":"Masked ebuilds with bad DEPEND settings (matched against *all* ebuilds) in developing arch",
        "RDEPEND.badmaskedindev":"Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch",
        "PDEPEND.badmaskedindev":"Masked ebuilds with PDEPEND settings (matched against *all* ebuilds) in developing arch",
+       "PDEPEND.suspect":"PDEPEND contains a package that usually only belongs in DEPEND.",
        "DEPEND.syntax":"Syntax error in DEPEND (usually an extra/missing space/parenthesis)",
        "RDEPEND.syntax":"Syntax error in RDEPEND (usually an extra/missing space/parenthesis)",
        "PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)",
@@ -342,6 +343,7 @@ qawarnings = set((
 "KEYWORDS.missing",
 "IUSE.invalid",
 "IUSE.undefined",
+"PDEPEND.suspect",
 "RDEPEND.implicit",
 "RDEPEND.suspect",
 "RESTRICT.invalid",
@@ -1411,10 +1413,11 @@ for x in scanlist:
                                for token in mydepstr.split():
                                        if token in operator_tokens or \
                                                token[-1:] == "?":
-                                               if token == "test?" and mytype == "RDEPEND":
-                                                       stats['RDEPEND.suspect'] += 1
-                                                       fails['RDEPEND.suspect'].append(relative_path + \
-                                                               ": 'test?' USE conditional in RDEPEND")
+                                               if token == "test?" and \
+                                                       mytype in ("RDEPEND", "PDEPEND"):
+                                                       stats[mytype + '.suspect'] += 1
+                                                       fails[mytype + '.suspect'].append(relative_path + \
+                                                               ": 'test?' USE conditional in %s" % mytype)
                                                continue
                                        try:
                                                atom = portage.dep.Atom(token)
@@ -1429,11 +1432,11 @@ for x in scanlist:
                                                        portage.dep_getkey(atom) == "virtual/jdk":
                                                        stats['java.eclassesnotused'] += 1
                                                        fails['java.eclassesnotused'].append(relative_path)
-                                               elif mytype == "RDEPEND":
+                                               elif mytype in ("PDEPEND", "RDEPEND"):
                                                        if not is_blocker and \
                                                                portage.dep_getkey(atom) in suspect_rdepend:
-                                                               stats['RDEPEND.suspect'] += 1
-                                                               fails['RDEPEND.suspect'].append(
+                                                               stats[mytype + '.suspect'] += 1
+                                                               fails[mytype + '.suspect'].append(
                                                                        relative_path + ": '%s'" % atom)
                                                if eapi == "0":
                                                        if portage.dep.dep_getslot(atom):
diff --git a/bin/setsid b/bin/setsid
deleted file mode 100755 (executable)
index 51ebaa3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!@PORTAGE_PYTHON@ -O
-# Copyright 2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-import os
-import sys
-
-os.setsid()
-os.execl(sys.argv[1], *sys.argv[1:])
index 555ff399540634f34627425d7c0056edfe3b56ac..13383a4237133e7f0038df00876515e556156527 100644 (file)
@@ -161,6 +161,9 @@ Masked ebuilds with PDEPEND settings (matched against *all* ebuilds)
 .B PDEPEND.badmaskedindev
 Masked ebuilds with PDEPEND settings (matched against *all* ebuilds) in developing arch
 .TP
+.B PDEPEND.suspect
+PDEPEND contains a package that usually only belongs in DEPEND
+.TP
 .B PDEPEND.syntax
 Syntax error in PDEPEND (usually an extra/missing space/parenthesis)
 .TP
index 1cfd0d6932cc67bf433da7b8fb7f3305dbf6f33c..f9363df9f9d6325c76d6745b2e1e15f36980a158 100644 (file)
@@ -714,14 +714,8 @@ class depgraph(object):
                                else:
                                        # Do not backtrack if only USE have to be changed in
                                        # order to satisfy the dependency.
-                                       atom_without_use = dep.atom
-                                       if dep.atom.use:
-                                               atom_without_use = portage.dep.remove_slot(dep.atom)
-                                               if dep.atom.slot:
-                                                       atom_without_use += ":" + dep.atom.slot
-                                               atom_without_use = portage.dep.Atom(atom_without_use)
                                        dep_pkg, existing_node = \
-                                               self._select_package(dep.root, atom_without_use,
+                                               self._select_package(dep.root, dep.atom.without_use,
                                                        onlydeps=dep.onlydeps)
                                        if dep_pkg is None:
                                                self._dynamic_config._runtime_pkg_mask.setdefault(
@@ -1847,12 +1841,6 @@ class depgraph(object):
        def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None):
                atom = portage.dep.Atom(atom)
                atom_set = InternalPackageSet(initial_atoms=(atom,))
-               atom_without_use = atom
-               if atom.use:
-                       atom_without_use = portage.dep.remove_slot(atom)
-                       if atom.slot:
-                               atom_without_use += ":" + atom.slot
-                       atom_without_use = portage.dep.Atom(atom_without_use)
                xinfo = '"%s"' % atom
                if arg:
                        xinfo='"%s"' % arg
@@ -1873,9 +1861,9 @@ class depgraph(object):
                                continue
                        match = db.match
                        if hasattr(db, "xmatch"):
-                               cpv_list = db.xmatch("match-all", atom_without_use)
+                               cpv_list = db.xmatch("match-all", atom.without_use)
                        else:
-                               cpv_list = db.match(atom_without_use)
+                               cpv_list = db.match(atom.without_use)
                        # descending order
                        cpv_list.reverse()
                        for cpv in cpv_list:
index c6c8d8583893548771be8eda2e56afd3f07f454a..0cb30da32f3b152bbc0ad9940dd5717be7f813c6 100644 (file)
@@ -31,7 +31,7 @@ import portage
 
 import _emerge.help
 import portage.xpak, commands, errno, re, time
-from portage.output import colorize, xtermTitleReset
+from portage.output import colorize, xtermTitle, xtermTitleReset
 from portage.output import create_color_func
 good = create_color_func("GOOD")
 bad = create_color_func("BAD")
@@ -1046,6 +1046,8 @@ def emerge_main():
                portdb = trees[settings["ROOT"]]["porttree"].dbapi
 
        xterm_titles = "notitles" not in settings.features
+       if xterm_titles:
+               xtermTitle("emerge")
 
        tmpcmdline = []
        if "--ignore-default-opts" not in myopts:
@@ -1306,7 +1308,7 @@ def emerge_main():
                """This gets out final log message in before we quit."""
                if "--pretend" not in myopts:
                        emergelog(xterm_titles, " *** terminating.")
-               if "notitles" not in settings.features:
+               if xterm_titles:
                        xtermTitleReset()
        portage.atexit_register(emergeexit)
 
index 61ffd65fde84d38461168c8dd14e7d3a98027ed4..e850dcdaee22b343453b9f75631f21bc7b427411 100644 (file)
@@ -1049,7 +1049,6 @@ class config(object):
                "EBUILD_PHASE", "EMERGE_FROM", "HOMEPAGE", "INHERITED", "IUSE",
                "KEYWORDS", "LICENSE", "PDEPEND", "PF", "PKGUSE",
                "PORTAGE_CONFIGROOT", "PORTAGE_IUSE", "PORTAGE_REPO_NAME",
-               "PORTAGE_SETSID",
                "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT",
                "ROOT", "SLOT", "SRC_URI", "EPREFIX", "EROOT"
        ]
@@ -6944,6 +6943,9 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                                if portage.dep._dep_check_strict:
                                        raise portage.exception.ParseError(
                                                "invalid atom: '%s'" % x)
+                               else:
+                                       # Only real Atom instances are allowed past this point.
+                                       continue
                        else:
                                if x.blocker and x.blocker.overlap.forbid and \
                                        eapi in ("0", "1") and portage.dep._dep_check_strict:
@@ -7165,7 +7167,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                for atom in atoms:
                        if atom[:1] == "!":
                                continue
-                       avail_pkg = mydbapi.match(atom)
+                       # Ignore USE dependencies here since we don't want USE
+                       # settings to adversely affect || preference evaluation.
+                       avail_pkg = mydbapi.match(atom.without_use)
                        if avail_pkg:
                                avail_pkg = avail_pkg[-1] # highest (ascending order)
                                avail_slot = "%s:%s" % (dep_getkey(atom),
index 679a8558df62005e3edeeda29354dcf0cb3ad2d4..64215b68c800aa018c15890536d5831d4f04e4bd 100644 (file)
@@ -511,7 +511,7 @@ class Atom(object):
        _atoms = weakref.WeakValueDictionary()
 
        __slots__ = ("__weakref__", "blocker", "cp", "cpv", "operator",
-               "slot", "use", "_str")
+               "slot", "use", "without_use", "_str",)
 
        class _blocker(object):
                __slots__ = ("overlap",)
@@ -550,9 +550,16 @@ class Atom(object):
                use = dep_getusedeps(s)
                if use:
                        use = _use_dep(use)
+                       without_use = remove_slot(self)
+                       if self.slot is not None:
+                               without_use += ":" + self.slot
+                       without_use = Atom(without_use)
                else:
                        use = None
+                       without_use = self
+
                obj_setattr(self, "use", use)
+               obj_setattr(self, "without_use", without_use)
 
        def __setattr__(self, name, value):
                raise AttributeError("Atom instances are immutable",