summaryrefslogtreecommitdiffstats
path: root/misc-scripts
diff options
context:
space:
mode:
authorFrancois Charette <francois@archlinux.org>2009-07-21 13:52:21 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-07-21 19:09:50 +0200
commit9cf363c8e055a5fec8bbf51f43ac8123b2fee742 (patch)
tree312e6c90d95e0d8c76580dab77a23c104a0cd7b7 /misc-scripts
parent820452a93f68c05ac1083d56d9e560903d8ae1cf (diff)
downloaddbscripts-9cf363c8e055a5fec8bbf51f43ac8123b2fee742.tar.gz
dbscripts-9cf363c8e055a5fec8bbf51f43ac8123b2fee742.tar.xz
Bugfix: make TMPDIR within the for loop
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'misc-scripts')
-rwxr-xr-xmisc-scripts/ftpdir-cleanup7
1 files changed, 5 insertions, 2 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index ee1dc2e..b28ec94 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -36,12 +36,12 @@ getpkgname() {
echo ${tmp%-*-*}
}
-TMPDIR=$(mktemp -d /tmp/cleanup-.XXXXXX) || exit 1
ftppath_base="$FTP_BASE/$reponame/$FTP_OS_SUFFIX"
for arch in ${ARCHES[@]}; do
+ TMPDIR=$(mktemp -d /tmp/cleanup-XXXXXX) || exit 1
ftppath="$ftppath_base/$arch"
MISSINGFILES=""
DELETEFILES=""
@@ -53,8 +53,11 @@ for arch in ${ARCHES[@]}; do
exit 1
fi
+ if ! cd "${TMPDIR}" ; then
+ echo "Failed to cd to ${TMPDIR}"
+ exit 1
+ fi
- cd "${TMPDIR}"
bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"
for pkg in *; do