if [ -z "${PORTAGE_BUILDDIR}" ]; then
echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
return 1
+ elif [ ! -d "${PORTAGE_BUILDDIR}" ] ; then
+ return 0
fi
-
if type -P chflags > /dev/null ; then
chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
fi
if ! hasq keepwork $FEATURES; then
+ rm -rf "${PORTAGE_BUILDDIR}/.exit_status"
rm -rf "${PORTAGE_BUILDDIR}/.logid"
rm -rf "${PORTAGE_BUILDDIR}/.unpacked"
rm -rf "${PORTAGE_BUILDDIR}/.compiled"
"correct your PORTAGE_TMPDIR setting.\n", noiselevel=-1)
return 1
+ if mydo == "unmerge":
+ return unmerge(mysettings["CATEGORY"],
+ mysettings["PF"], myroot, mysettings, vartree=vartree)
+
# Build directory creation isn't required for any of these.
have_build_dirs = False
- if mydo not in ("digest", "fetch", "help", "manifest"):
+ if mydo not in ("clean", "digest", "fetch", "help", "manifest"):
mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
if mystatus:
return mystatus
logfile = mysettings.get("PORTAGE_LOG_FILE")
if logfile and not os.access(os.path.dirname(logfile), os.W_OK):
logfile = None
-
if have_build_dirs:
_doebuild_exit_status_unlink(
mysettings.get("EBUILD_EXIT_STATUS_FILE"))
else:
mysettings.pop("EBUILD_EXIT_STATUS_FILE", None)
- if mydo == "unmerge":
- return unmerge(mysettings["CATEGORY"],
- mysettings["PF"], myroot, mysettings, vartree=vartree)
# if any of these are being called, handle them -- running them out of
# the sandbox -- and stop now.