summaryrefslogtreecommitdiffstats
path: root/misc-scripts/ftpdir-cleanup
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-04-11 14:12:16 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-04-11 14:12:16 +0200
commit52b668dc79b2ca05f9eebedab0dfc7eefb263765 (patch)
tree2867c1f9f0547c0f99166e40c9f61d7ba6fefc77 /misc-scripts/ftpdir-cleanup
parentad520b527f3c5d2471e4b471eca5439643a01939 (diff)
downloaddbscripts-52b668dc79b2ca05f9eebedab0dfc7eefb263765.tar.gz
dbscripts-52b668dc79b2ca05f9eebedab0dfc7eefb263765.tar.xz
Do not overwrite TMPDIR defined in config20100411
Diffstat (limited to 'misc-scripts/ftpdir-cleanup')
-rwxr-xr-xmisc-scripts/ftpdir-cleanup12
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