Merged from trunk -r13286:13290
authorFabian Groffen <grobian@gentoo.org>
Sat, 11 Apr 2009 11:22:36 +0000 (11:22 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 11 Apr 2009 11:22:36 +0000 (11:22 -0000)
   | 13287   | If there are not ebuilds matching a argument, only generate  |
   | zmedico | an error if there are also no cache entries matching the     |
   |         | argument.                                                    |

   | 13288   | Always generate an error if the target cache contains an     |
   | zmedico | apparently invalid cpv.                                      |

   | 13289   | Add an example for PORTAGE_IONICE_COMMAND. Thanks to         |
   | zmedico | Vlastimil Babka <caster@g.o> for the suggestion.             |

   | 13290   | Bug #262647 - Inside config.setcpv(), never add SRC_URI to   |
   | zmedico | the environment since that can cause execve() calls to fail  |
   |         | with E2BIG errors.                                           |

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

acinclude.m4
bin/egencache
cnf/make.conf
pym/portage/__init__.py

index d305e3a5212ca7c9b22f4085d9221df5a1f2c428..07714f3a10c20186cad4f79e2779a75995af1504 100644 (file)
@@ -44,7 +44,7 @@ AC_DEFUN([GENTOO_PATH_XCU_ID],
 
   dnl does it support all the bells and whistles we need?
   AC_MSG_CHECKING([whether $XCU_ID is good enough])
-  for a in '' '-G' '-Gn' '-g' '-gn' '-gr' '-gnr' '-u' '-un' '-ur' '-unr' ; do
+  for a in '' '-u' '-g' ; do
     if ! "$XCU_ID" $a >/dev/null 2>&1 ; then
       XCU_ID=no
       break
index 923bd16646efec03790012741c3b664528092a40..487901cf085b4911f679dfb3337e75f4f248a8f7 100755 (executable)
@@ -26,6 +26,7 @@ import portage
 import _emerge
 from portage.cache.cache_errors import CacheError, StatCollision
 from portage.util import writemsg_level
+from portage import cpv_getkey
 
 def parse_args(args):
        usage = "egencache [options] --update [atom] ..."
@@ -133,7 +134,7 @@ class GenCache(object):
 
        def _metadata_callback(self, cpv, ebuild_path, repo_path, metadata):
                self._existing_nodes.add(cpv)
-               self._cp_missing.discard(portage.cpv_getkey(cpv))
+               self._cp_missing.discard(cpv_getkey(cpv))
                if metadata is not None:
                        if metadata.get('EAPI') == '0':
                                del metadata['EAPI']
@@ -176,19 +177,21 @@ class GenCache(object):
        def run(self):
                self._regen.run()
                self.returncode |= self._regen.returncode
-
-               if self._cp_missing:
-                       self.returncode |= 1
-                       for cp in sorted(self._cp_missing):
-                               writemsg_level(
-                                       "No ebuilds found for '%s'\n"  % (cp,),
-                                       level=logging.ERROR, noiselevel=-1)
+               cp_missing = self._cp_missing
 
                trg_cache = self._trg_cache
-               dead_nodes = None
+               dead_nodes = set()
                if self._global_cleanse:
                        try:
-                               dead_nodes = set(trg_cache.iterkeys())
+                               for cpv in trg_cache.iterkeys():
+                                       cp = cpv_getkey(cpv)
+                                       if cp is None:
+                                               self.returncode |= 1
+                                               writemsg_level(
+                                                       "Unable to parse cp for '%s'\n"  % (cpv,),
+                                                       level=logging.ERROR, noiselevel=-1)
+                                       else:
+                                               dead_nodes.add(cpv)
                        except CacheError, ce:
                                self.returncode |= 1
                                writemsg_level(
@@ -199,11 +202,18 @@ class GenCache(object):
 
                else:
                        cp_set = self._cp_set
-                       cpv_getkey = portage.cpv_getkey
                        try:
-                               dead_nodes = set(cpv for cpv in \
-                                       trg_cache.iterkeys() \
-                                       if cpv_getkey(cpv) in cp_set)
+                               for cpv in trg_cache.iterkeys():
+                                       cp = cpv_getkey(cpv)
+                                       if cp is None:
+                                               self.returncode |= 1
+                                               writemsg_level(
+                                                       "Unable to parse cp for '%s'\n"  % (cpv,),
+                                                       level=logging.ERROR, noiselevel=-1)
+                                       else:
+                                               cp_missing.discard(cp)
+                                               if cp in cp_set:
+                                                       dead_nodes.add(cpv)
                        except CacheError, ce:
                                self.returncode |= 1
                                writemsg_level(
@@ -212,6 +222,13 @@ class GenCache(object):
                                        (self._portdb.porttree_root, ce),
                                        level=logging.ERROR, noiselevel=-1)
 
+               if cp_missing:
+                       self.returncode |= 1
+                       for cp in sorted(cp_missing):
+                               writemsg_level(
+                                       "No ebuilds or cache entries found for '%s'\n"  % (cp,),
+                                       level=logging.ERROR, noiselevel=-1)
+
                if dead_nodes:
                        dead_nodes.difference_update(self._existing_nodes)
                        for k in dead_nodes:
index 64a8ecff20a825ecc1cb5ef5ba5b6cd68e9596a2..252105f7c3bf62fa776801b4baa601937c0ada5b 100644 (file)
 #     reduce it further. Default is unset.
 #PORTAGE_NICENESS=3
 #
+# PORTAGE_IONICE_COMMAND provides a command for portage to call in order to
+#     adjust the io priority of portage and it's subprocesses. Default is
+#     unset.
+#PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
+#
 # AUTOCLEAN enables portage to automatically clean out older or overlapping
 #     packages from the system after every successful merge. This is the
 #     same as running 'emerge -c' after every merge. Set with: "yes" or "no".
index b91dd006de63fcc74f9d1ffd638aa31b22037006..88ec62c4bf2848ab5450df2c1549870bd6c626ef 100644 (file)
@@ -999,6 +999,13 @@ class config(object):
        virtuals ...etc you look in here.
        """
 
+       # Don't include anything that could be extremely long here (like SRC_URI)
+       # since that could cause execve() calls to fail with E2BIG errors. For
+       # example, see bug #262647.
+       _setcpv_aux_keys = ('SLOT', 'RESTRICT', 'LICENSE',
+               'KEYWORDS',  'INHERITED', 'IUSE', 'PROVIDE', 'EAPI',
+               'PROPERTIES', 'DEFINED_PHASES', 'repository')
+
        _env_blacklist = [
                "A", "AA", "CATEGORY", "DEPEND", "DESCRIPTION", "EAPI",
                "EBUILD_PHASE", "EMERGE_FROM", "HOMEPAGE", "INHERITED", "IUSE",
@@ -2125,9 +2132,7 @@ class config(object):
                pkg_configdict = self.configdict["pkg"]
                previous_iuse = pkg_configdict.get("IUSE")
 
-               aux_keys = [k for k in auxdbkeys \
-                       if not k.startswith("UNUSED_")]
-               aux_keys.append("repository")
+               aux_keys = self._setcpv_aux_keys
 
                # Discard any existing metadata from the previous package, but
                # preserve things like USE_EXPAND values and PORTAGE_USE which
@@ -2139,7 +2144,8 @@ class config(object):
                pkg_configdict["PF"] = pf
                if mydb:
                        if not hasattr(mydb, "aux_get"):
-                               pkg_configdict.update(mydb)
+                               for k in aux_keys:
+                                       pkg_configdict[k] = mydb.get(k, '')
                        else:
                                for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
                                        pkg_configdict[k] = v