diff options
author | Francois Charette <francois@samarqand.localdomain> | 2009-05-12 10:35:33 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-05-12 13:04:13 -0700 |
commit | 9925af8a8aa791026f0f51a9be601bfbc15d0a40 (patch) | |
tree | 4421e463a2b4ce7a07ddad48c5a78a1e350a758f | |
parent | f515029a694a11065f95a79bd83b325bf04562bb (diff) |
Check whether packages exist in build dirs before attempting to copy them
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-x | db-update | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -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 |