From 9925af8a8aa791026f0f51a9be601bfbc15d0a40 Mon Sep 17 00:00:00 2001 From: Francois Charette Date: Tue, 12 May 2009 10:35:33 +0200 Subject: Check whether packages exist in build dirs before attempting to copy them Signed-off-by: Aaron Griffin --- db-update | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index cb00f39..132049f 100755 --- a/db-update +++ b/db-update @@ -204,19 +204,23 @@ for A in ${ARCHES[@]}; do # 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'" - for f in "$WORKDIR/build/"*$current_arch$PKGEXT; do - if ! /bin/cp "$f" "$ftppath"; then - die "error: failure while copying files to $ftppath" - fi - done - for f in "$WORKDIR/build/"*any.pkg.tar.gz; do - if ! /bin/cp "$f" "$ftppath_any"; then - die "error: failure while copying files to $ftppath_any" - fi - if ! ln -s "$ftppath_any/$f" "$ftppath/$f"; then - die "error: failed to make link for $f." - fi - done + if [ $(/bin/ls "$WORKDIR/build/"*$current_arch$PKGEXT 2>/dev/null | wc -l) != 0 ]; then + for f in "$WORKDIR/build/"*$current_arch$PKGEXT; do + if ! /bin/cp "$f" "$ftppath"; then + die "error: failure while copying files to $ftppath" + fi + done + fi + if [ $(/bin/ls "$WORKDIR/build/"*any$PKGEXT 2>/dev/null | wc -l) != 0 ]; then + for f in "$WORKDIR/build/"*any$PKGEXT; do + if ! /bin/cp "$f" "$ftppath_any"; then + die "error: failure while copying files to $ftppath_any" + fi + if ! ln -s "$ftppath_any/$f" "$ftppath/$f"; then + die "error: failed to make link for $f." + fi + done + fi if ! /bin/cp "$WORKDIR/build/$reponame.db"* "$ftppath"; then die "failed to move repository $reponame-$A". fi -- cgit v1.2.3-24-g4f1b