From 9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 17 Aug 2012 18:07:15 -0700 Subject: [PATCH] emerge-delta-webrsync: check write permission This will fix bug #176008. --- misc/emerge-delta-webrsync | 19 +++++++++++++++---- 1 file 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" -- 2.26.2