From 01d2e01a129a4ded9ccba2659250a94cb3fddd36 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sat, 30 Aug 2008 21:08:15 -0500 Subject: 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 Signed-off-by: Aaron Griffin --- db-update | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'db-update') 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" -- cgit v1.2.3-24-g4f1b