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
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] ..."
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']
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(
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(
(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:
# 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".
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",
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
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