diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-08-30 21:08:15 -0500 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2008-08-30 21:08:15 -0500 |
commit | 01d2e01a129a4ded9ccba2659250a94cb3fddd36 (patch) | |
tree | 8b132b28719d71eb3156d7a75852826ff14938a6 /db-update | |
parent | 7f0886c7e8935352007d6ba8acc6d9e28b55f2da (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>
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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" |