diff options
-rwxr-xr-x | misc/emerge-delta-webrsync | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index e23316a8e..3b934ffe9 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -97,11 +97,22 @@ if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then exit 1 fi -if [[ ! -d $DISTDIR ]] ; then - mkdir -p $DISTDIR +[[ -d ${PORTDIR} ]] || mkdir -p "${PORTDIR}" +if [[ ! -w ${PORTDIR} ]] ; then + eecho "PORTDIR is not writable: ${PORTDIR}" + exit 1 +fi + +[[ -d ${DISTDIR} ]] || mkdir -p "${DISTDIR}" +if [[ ! -w ${DISTDIR} ]] ; then + eecho "DISTDIR is not writable: ${DISTDIR}" + exit 1 fi -if [[ ! -d $TMPDIR ]]; then - mkdir -p $TMPDIR + +[[ -d ${TMPDIR} ]] || mkdir -p "${TMPDIR}" +if [[ ! -w ${TMPDIR} ]] ; then + eecho "TMPDIR is not writable: ${TMPDIR}" + exit 1 fi cd "$DISTDIR" |