summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-08-30 21:08:15 -0500
committerAaron Griffin <aaronmgriffin@gmail.com>2008-08-30 21:08:15 -0500
commit01d2e01a129a4ded9ccba2659250a94cb3fddd36 (patch)
tree8b132b28719d71eb3156d7a75852826ff14938a6
parent7f0886c7e8935352007d6ba8acc6d9e28b55f2da (diff)
Prevent staging cleanup if copy to repo fails
This stops files being removed from the staging area if they were not successfully copied to the repo. This can happen due to permission issues with the database when multiple people update the repo in quick succession. Original-work-by: Allan McRae <allan@archlinux.org> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xdb-update4
1 files changed, 3 insertions, 1 deletions
diff --git a/db-update b/db-update
index 7ff768e..4b2571d 100755
--- a/db-update
+++ b/db-update
@@ -198,7 +198,9 @@ fi
# if non empty, move all build dirs
if [ $(/bin/ls "$WORKDIR/build/" 2>/dev/null | wc -l) != 0 ]; then
echo "Copying new files to '$ftppath'"
- /bin/cp -r "$WORKDIR/build/"* "$ftppath"
+ if ! /bin/cp -r "$WORKDIR/build/"* "$ftppath"; then
+ die "error: failure while copying files to $ftppath"
+ fi
else
echo "Nothing to copy, no work done"