summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 71bb78071..1402f71a4 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -714,8 +714,10 @@ dyn_unpack() {
fi
fi
- install -m0700 -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
- [ -d "$WORKDIR" ] && cd "${WORKDIR}"
+ if [ ! -d "${WORKDIR}" ]; then
+ install -m${PORTAGE_WORKDIR_MODE-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
+ fi
+ cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
echo ">>> Unpacking source..."
src_unpack
touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}"