tmpsettings["FEATURES"] = " ".join(sorted(tmpsettings.features))
tmpsettings.backup_changes("FEATURES")
+if 'fail-clean' in tmpsettings.features:
+ tmpsettings.features.remove('fail-clean')
+ tmpsettings["FEATURES"] = " ".join(sorted(tmpsettings.features))
+ tmpsettings.backup_changes("FEATURES")
+
if opts.skip_manifest:
tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
| sed -e '1d' -e 's:^:RETAIN-LEADING-SPACE:' \
| while read -r n ; do eerror " ${n#RETAIN-LEADING-SPACE}" ; done
eerror
- eerror "If you need support, post the topmost build error, and the call stack if relevant."
+ eerror "If you need support, post the output of 'emerge --info =$CATEGORY/$PF',"
+ eerror "the complete build log and the output of 'emerge -pqv =$CATEGORY/$PF'."
if [[ -n ${EBUILD_OVERLAY_ECLASSES} ]] ; then
eerror "This ebuild used the following eclasses from overlays:"
local x
fi
[[ -n ${PORTAGE_LOG_FILE} ]] \
- && eerror "A complete build log is located at '${PORTAGE_LOG_FILE}'."
+ && eerror "The complete build log is located at '${PORTAGE_LOG_FILE}'."
if [ -f "${T}/environment" ] ; then
eerror "The ebuild environment file is located at '${T}/environment'."
elif [ -d "${T}" ] ; then
little as possible. You should run with \fB\-\-pretend\fR first to make
sure the result is what you expect.
.TP
+.BR "\-\-fail\-clean[=n]"
+Clean up temporary files after a build failure. This is
+particularly useful if you have \fBPORTAGE_TMPDIR\fR on
+tmpfs. If this option is enabled, you probably also want
+to enable \fBPORT_LOGDIR\fR (see \fBmake.conf\fR(5)) in
+order to save the build log.
+.TP
.BR "\-\-fetchonly " (\fB\-f\fR)
Instead of doing any package building, just perform fetches for all
packages (fetch things from SRC_URI based upon USE setting).
Enable fakeroot for the install and package phases when a non-root user runs
the \fBebuild\fR(1) command.
.TP
+.B fail\-clean
+Clean up temporary files after a build failure. This is particularly useful
+if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you
+probably also want to enable \fBPORT_LOGDIR\fR in order to save the build log.
+Both the \fBebuild\fR(1) command and the \fInoclean\fR feature cause the
+\fIfail\-clean\fR feature to be automatically disabled.
+.TP
.B fixpackages
Runs the script that will fix the dependencies in all binary packages. This is
run whenever packages are moved around in the portage tree. Please note that this
from putting 64bit libraries into anything other than (/usr)/lib64.
.TP
.B news
-Enable GLEP 42 new support. See
+Enable GLEP 42 news support. See
\fIhttp://www.gentoo.org/proj/en/glep/glep-0042.html\fR.
.TP
.B noauto
log_file.close()
if self._default_exit(ebuild_process) != os.EX_OK:
+ if self.phase != 'clean' and \
+ 'noclean' not in self.settings.features and \
+ 'fail-clean' in self.settings.features:
+ self._fail_clean()
+ return
self.wait()
return
if self._final_exit(post_phase) != os.EX_OK:
writemsg("!!! post %s failed; exiting.\n" % self.phase,
noiselevel=-1)
+ if self.phase != 'clean' and \
+ 'noclean' not in self.settings.features and \
+ 'fail-clean' in self.settings.features:
+ self._fail_clean()
+ return
self._current_task = None
self.wait()
return
+ def _fail_clean(self):
+ self.returncode = None
+ portage.elog.elog_process(self.pkg.cpv, self.settings)
+ phase = "clean"
+ clean_phase = EbuildPhase(background=self.background,
+ pkg=self.pkg, phase=phase,
+ scheduler=self.scheduler, settings=self.settings,
+ tree=self.tree)
+ self._start_task(clean_phase, self._fail_clean_exit)
+ return
+
+ def _fail_clean_exit(self, clean_phase):
+ self._final_exit(clean_phase)
+ self.returncode = 1
+ self.wait()
self.restrict_fetch = 0
self.restrict_fetch_satisfied = 0
self.interactive = 0
+ self.binary = 0
def __str__(self):
total_installs = self.upgrades + self.downgrades + self.newslot + self.new + self.reinst
details.append("%s reinstall" % self.reinst)
if self.reinst > 1:
details[-1] += "s"
+ if self.binary > 0:
+ details.append("%s binary" % self.binary)
+ if self.binary > 1:
+ details[-1] = details[-1][:-1] + "ies"
if self.uninst > 0:
details.append("%s uninstall" % self.uninst)
if self.uninst > 1:
self.pkgsettings[root] = portage.config(
clone=root_config.settings)
+ keep_going = "--keep-going" in self.myopts
+ fetchonly = self._build_opts.fetchonly
+ mtimedb = self._mtimedb
+ failed_pkgs = self._failed_pkgs
+
rval = self._generate_digests()
if rval != os.EX_OK:
return rval
+ # TODO: Immediately recalculate deps here if --keep-going
+ # is enabled and corrupt manifests are detected.
rval = self._check_manifests()
- if rval != os.EX_OK:
+ if rval != os.EX_OK and not keep_going:
return rval
- keep_going = "--keep-going" in self.myopts
- fetchonly = self._build_opts.fetchonly
- mtimedb = self._mtimedb
- failed_pkgs = self._failed_pkgs
-
while True:
rval = self._merge()
if rval == os.EX_OK or fetchonly or not keep_going:
settings['FEATURES'] = ' '.join(sorted(settings.features))
settings.backup_changes("FEATURES")
+ fail_clean = myopts.get('--fail-clean')
+ if fail_clean is not None:
+ if fail_clean is True and \
+ 'fail-clean' not in settings.features:
+ settings.features.add('fail-clean')
+ settings['FEATURES'] = ' '.join(sorted(settings.features))
+ settings.backup_changes('FEATURES')
+ elif fail_clean == 'n' and \
+ 'fail-clean' in settings.features:
+ settings.features.remove('fail-clean')
+ settings['FEATURES'] = ' '.join(sorted(settings.features))
+ settings.backup_changes('FEATURES')
+
CLEAN_DELAY = 5
try:
CLEAN_DELAY = int(settings.get("CLEAN_DELAY", str(CLEAN_DELAY)))
expanded_atoms = [atom for atom in expanded_atoms \
if atom.cp == installed_cp]
+ # If a non-virtual package and one or more virtual packages
+ # are in expanded_atoms, use the non-virtual package.
+ if len(expanded_atoms) > 1:
+ number_of_virtuals = 0
+ for expanded_atom in expanded_atoms:
+ if expanded_atom.cp.startswith("virtual/"):
+ number_of_virtuals += 1
+ else:
+ candidate = expanded_atom
+ if len(expanded_atoms) - number_of_virtuals == 1:
+ expanded_atoms = [ candidate ]
+
if len(expanded_atoms) > 1:
print()
print()
if ordered:
if pkg_merge:
counters.reinst += 1
+ if pkg_type == "binary":
+ counters.binary += 1
elif pkg_status == "uninstall":
counters.uninst += 1
# filter out old-style virtual matches
addl += turquoise("U")+blue("D")
if ordered:
counters.downgrades += 1
+ if pkg_type == "binary":
+ counters.binary += 1
else:
# Update in slot
addl += turquoise("U") + " "
if ordered:
counters.upgrades += 1
+ if pkg_type == "binary":
+ counters.binary += 1
else:
# New slot, mark it new.
addl = " " + green("NS") + fetch + " "
myoldbest = vardb.match(portage.cpv_getkey(pkg_key))
if ordered:
counters.newslot += 1
+ if pkg_type == "binary":
+ counters.binary += 1
if "--changelog" in self._frozen_config.myopts:
inst_matches = vardb.match(pkg.slot_atom)
addl = " " + green("N") + " " + fetch + " "
if ordered:
counters.new += 1
+ if pkg_type == "binary":
+ counters.binary += 1
verboseadd = ""
repoadd = None
print(" it possible for developers to get a complete overview of the")
print(" complete dependency tree of a certain package.")
print()
+ print(" "+green("--fail-clean[=n]"))
+ desc = "Clean up temporary files after a build failure. This is " + \
+ "particularly useful if you have PORTAGE_TMPDIR on " + \
+ "tmpfs. If this option is enabled, you probably also want " + \
+ "to enable PORT_LOGDIR (see make.conf(5)) in " + \
+ "order to save the build log."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" "+green("--fetchonly")+" ("+green("-f")+" short option)")
print(" Instead of doing any package building, just perform fetches for")
print(" all packages (main package as well as all dependencies.) When")
'--deep' : valid_integers,
'--deselect' : ('n',),
'--binpkg-respect-use' : ('n', 'y',),
+ '--fail-clean' : ('n',),
'--getbinpkg' : ('n',),
'--getbinpkgonly' : ('n',),
'--jobs' : valid_integers,
"choices" : ("True", "n")
},
+ "--fail-clean": {
+ "help" : "clean temp files after build failure",
+ "type" : "choice",
+ "choices" : ("True", "n")
+ },
+
"--jobs": {
"shortopt" : "-j",
else:
myoptions.complete_graph = None
+ if myoptions.fail_clean == "True":
+ myoptions.fail_clean = True
+
if myoptions.getbinpkg in ("True",):
myoptions.getbinpkg = True
else:
# In some cases, openpty can be slow when it fails. Therefore,
# stop trying to use it after the first failure.
-if platform.system() not in ["Linux"]:
+if platform.system() not in ["FreeBSD", "Linux"]:
# Disable the use of openpty on Solaris as it seems Python's openpty
# implementation doesn't play nice on Solaris with Portage's
# behaviour causing hangs/deadlocks.
# Process ebuild logfiles
elog_process(self.mycpv, self.settings, phasefilter=filter_mergephases)
- if retval == os.EX_OK and "noclean" not in self.settings.features:
+ if 'noclean' not in self.settings.features and \
+ (retval == os.EX_OK or \
+ ('fail-clean' in self.settings.features and \
+ os.path.isdir(self.settings['PORTAGE_BUILDDIR']))):
if myebuild is None:
myebuild = os.path.join(inforoot, self.pkg + ".ebuild")