summaryrefslogtreecommitdiffstats
path: root/misc-scripts/ftpdir-cleanup
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2009-08-16 15:45:00 +0200
committerThomas Bächler <thomas@archlinux.org>2009-08-16 15:45:00 +0200
commita51de5f2ba853a64fc9842e337cb25e000fdbbc1 (patch)
treebdc0b8867aadd2fe6f59925fd55031eaf79380e5 /misc-scripts/ftpdir-cleanup
parent5fa1331e0949f4cbdc6cbe0a6946e3fd185979b7 (diff)
downloaddbscripts-a51de5f2ba853a64fc9842e337cb25e000fdbbc1.tar.gz
dbscripts-a51de5f2ba853a64fc9842e337cb25e000fdbbc1.tar.xz
Make ftpdir-cleanup NOT delete all packages if databas extraction fails
Diffstat (limited to 'misc-scripts/ftpdir-cleanup')
-rwxr-xr-xmisc-scripts/ftpdir-cleanup13
1 files changed, 12 insertions, 1 deletions
diff --git a/misc-scripts/ftpdir-cleanup b/misc-scripts/ftpdir-cleanup
index 9331a4e..222811b 100755
--- a/misc-scripts/ftpdir-cleanup
+++ b/misc-scripts/ftpdir-cleanup
@@ -58,7 +58,18 @@ for arch in ${ARCHES[@]}; do
exit 1
fi
- bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"
+ if [ ! -f "$ftppath/$reponame.db.tar.$DB_COMPRESSION" ]; then
+ echo ""
+ echo "ERROR: The file \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\" could not be found, aborting."
+ echo ""
+ exit 1
+ fi
+
+ if ! bsdtar xf "$ftppath/$reponame.db.tar.$DB_COMPRESSION"; then
+ echo ""
+ echo "ERROR: Command failed: bsdtar xf \"$ftppath/$reponame.db.tar.$DB_COMPRESSION\""
+ exit 1
+ fi
for pkg in *; do
filename=$(grep -A1 '^%FILENAME%$' "${pkg}/desc" | tail -n1)