diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-04-11 14:12:16 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-04-11 14:12:16 +0200 |
commit | 52b668dc79b2ca05f9eebedab0dfc7eefb263765 (patch) | |
tree | 2867c1f9f0547c0f99166e40c9f61d7ba6fefc77 /misc-scripts/ftpdir-cleanup | |
parent | ad520b527f3c5d2471e4b471eca5439643a01939 (diff) |
Do not overwrite TMPDIR defined in config
Diffstat (limited to 'misc-scripts/ftpdir-cleanup')
-rwxr-xr-x | misc-scripts/ftpdir-cleanup | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup index d5f5737..1090d57 100755 --- a/misc-scripts/ftpdir-cleanup +++ b/misc-scripts/ftpdir-cleanup @@ -32,7 +32,7 @@ for arch in ${ARCHES[@]}; do repo_lock $reponame $arch $LOCK_TIMEOUT || continue - TMPDIR=$(mktemp -d /tmp/cleanup-XXXXXX) || exit 1 + CLEANUP_TMPDIR=$(mktemp -d ${TMPDIR}/cleanup-XXXXXX) || exit 1 ftppath="$ftppath_base/$arch" MISSINGFILES="" DELETEFILES="" @@ -44,8 +44,8 @@ for arch in ${ARCHES[@]}; do exit 1 fi - if ! cd "${TMPDIR}" ; then - echo "Failed to cd to ${TMPDIR}" + if ! cd "${CLEANUP_TMPDIR}" ; then + echo "Failed to cd to ${CLEANUP_TMPDIR}" exit 1 fi @@ -64,7 +64,7 @@ for arch in ${ARCHES[@]}; do cd "$ftppath" - for pkg in $TMPDIR/*; do + for pkg in $CLEANUP_TMPDIR/*; do filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1) if [ ! -e "${filename}" ]; then @@ -88,7 +88,7 @@ for arch in ${ARCHES[@]}; do continue fi pkgname="$(getpkgname $pkg)" - for p in ${TMPDIR}/${pkgname}-*; do + for p in ${CLEANUP_TMPDIR}/${pkgname}-*; do [ ! -d "${p}" ] || continue 2 dbpkgname=$(grep -A1 '^%FILENAME%$' "${p}/desc" 2>/dev/null| tail -n1) if [ "${dbpkgname}" = "${pkgname}" ]; then @@ -98,7 +98,7 @@ for arch in ${ARCHES[@]}; do EXTRAFILES="$EXTRAFILES $pkg" done - rm -rf ${TMPDIR} + rm -rf ${CLEANUP_TMPDIR} # Do a quick check to see if a missing ARCHINDEPFILE is in the any dir # If it is, and the file is MISSING, restore it |