"metadata/cache", portage.auxdbkeys[:])
if rsync:
self._trg_cache.raise_stat_collision = True
+ try:
+ self._trg_cache.ec = \
+ portdb._repo_info[portdb.porttrees[0]].eclass_db
+ except AttributeError:
+ pass
self._existing_nodes = set()
def _metadata_callback(self, cpv, ebuild_path, repo_path, metadata):
"--help", "--ignore-default-opts",
"--keep-going",
"--noconfmem",
-"--newuse", "--nocolor",
+"--newuse",
"--nodeps", "--noreplace",
"--nospinner", "--oneshot",
"--onlydeps", "--pretend",
if buf:
if not self.background:
- buf.tofile(files.stdout)
- files.stdout.flush()
+ write_successful = False
+ failures = 0
+ while True:
+ try:
+ if not write_successful:
+ buf.tofile(files.stdout)
+ write_successful = True
+ files.stdout.flush()
+ break
+ except IOError, e:
+ if e.errno != errno.EAGAIN:
+ raise
+ del e
+ failures += 1
+ if failures > 50:
+ # Avoid a potentially infinite loop. In
+ # most cases, the failure count is zero
+ # and it's unlikely to exceed 1.
+ raise
+
+ # This means that a subprocess has put an inherited
+ # stdio file descriptor (typically stdin) into
+ # O_NONBLOCK mode. This is not acceptable (see bug
+ # #264435), so revert it. We need to use a loop
+ # here since there's a race condition due to
+ # parallel processes being able to change the
+ # flags on the inherited file descriptor.
+ # TODO: When possible, avoid having child processes
+ # inherit stdio file descriptors from portage
+ # (maybe it can't be avoided with
+ # PROPERTIES=interactive).
+ fcntl.fcntl(files.stdout.fileno(), fcntl.F_SETFL,
+ fcntl.fcntl(files.stdout.fileno(),
+ fcntl.F_GETFL) ^ os.O_NONBLOCK)
+
buf.tofile(files.log)
files.log.flush()
else:
if world_locked:
world_set.unlock()
- def loadResumeCommand(self, resume_data, skip_masked=False):
+ def loadResumeCommand(self, resume_data, skip_masked=True,
+ skip_missing=True):
"""
Add a resume command to the graph and validate it in the process. This
will raise a PackageNotFound exception if a package is not available.
# It does no exist or it is corrupt.
if action == "uninstall":
continue
+ if skip_missing:
+ # TODO: log these somewhere
+ continue
raise portage.exception.PackageNotFound(pkg_key)
installed = action == "uninstall"
built = pkg_type != "ebuild"
if mydb:
if not hasattr(mydb, "aux_get"):
for k in aux_keys:
- pkg_configdict[k] = mydb.get(k, '')
+ v = mydb.get(k)
+ if v is not None:
+ pkg_configdict[k] = v
else:
for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
pkg_configdict[k] = v
if returnpid:
return phase_retval
- if phase_retval == os.EX_OK:
- msg = _doebuild_exit_status_check(mydo, mysettings)
- if msg:
+ msg = _doebuild_exit_status_check(mydo, mysettings)
+ if msg:
+ if phase_retval == os.EX_OK:
phase_retval = 1
- from textwrap import wrap
- from portage.elog.messages import eerror
- for l in wrap(msg, 72):
- eerror(l, phase=mydo, key=mysettings.mycpv)
+ from textwrap import wrap
+ from portage.elog.messages import eerror
+ for l in wrap(msg, 72):
+ eerror(l, phase=mydo, key=mysettings.mycpv)
_post_phase_userpriv_perms(mysettings)
if mydo == "install":
logfile=logfile, **kwargs)
finally:
pass
- if rval == os.EX_OK:
- msg = _doebuild_exit_status_check(mydo, mysettings)
- if msg:
+
+ msg = _doebuild_exit_status_check(mydo, mysettings)
+ if msg:
+ if rval == os.EX_OK:
rval = 1
- from textwrap import wrap
- from portage.elog.messages import eerror
- for l in wrap(msg, 72):
- eerror(l, phase=mydo, key=mysettings.mycpv)
+ from textwrap import wrap
+ from portage.elog.messages import eerror
+ for l in wrap(msg, 72):
+ eerror(l, phase=mydo, key=mysettings.mycpv)
+
return rval
_testing_eapis = frozenset(["3_pre1"])
return msg
def _doebuild_exit_status_check_and_log(settings, mydo, retval):
- if retval != os.EX_OK:
- return retval
msg = _doebuild_exit_status_check(mydo, settings)
if msg:
- retval = 1
+ if retval == os.EX_OK:
+ retval = 1
from textwrap import wrap
from portage.elog.messages import eerror
for l in wrap(msg, 72):
_doebuild_manifest_cache = mf
def exit_status_check(retval):
- if retval != os.EX_OK:
- return retval
msg = _doebuild_exit_status_check(mydo, mysettings)
if msg:
- retval = 1
+ if retval == os.EX_OK:
+ retval = 1
from textwrap import wrap
from portage.elog.messages import eerror
for l in wrap(msg, 72):
def append(self, other):
"""
Append another instance to this instance. This will cause eclasses
- from the other instance to override and eclases from this instance
+ from the other instance to override any eclasses from this instance
that have the same name.
"""
if not isinstance(other, self.__class__):