From e9bf11fe6952fa6fb8419b312e039963e3a5bcb4 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sun, 24 Jul 2016 23:40:09 +0200 Subject: reproducible_html_rsync_remote_results: check the existence of the old directory before moving fails on lede because there isn't any lede directory before Signed-off-by: Holger Levsen --- bin/reproducible_html_rsync_remote_results.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'bin/reproducible_html_rsync_remote_results.sh') diff --git a/bin/reproducible_html_rsync_remote_results.sh b/bin/reproducible_html_rsync_remote_results.sh index d459f58b..f19b92cd 100755 --- a/bin/reproducible_html_rsync_remote_results.sh +++ b/bin/reproducible_html_rsync_remote_results.sh @@ -19,15 +19,17 @@ rsync_remote_results() { rsync -r -v -e "ssh -o 'Batchmode = yes'" profitbricks-build3-amd64.debian.net:$BASE/$PROJECT/ $RESULTS chmod 775 $RESULTS # move old results out of the way - mv $BASE/$PROJECT ${RESULTS}.tmp - # preserve images and css - for OBJECT in $(find ${RESULTS}.tmp -name "*css" -o -name "*png" -o -name "*jpg") ; do - cp -v $OBJECT $RESULTS/ - done + if [ -d $BASE/$PROJECT ] ; then + mv $BASE/$PROJECT ${RESULTS}.tmp + # preserve images and css + for OBJECT in $(find ${RESULTS}.tmp -name "*css" -o -name "*png" -o -name "*jpg") ; do + cp -v $OBJECT $RESULTS/ + done + # delete the old results + rm ${RESULTS}.tmp -r + fi # make the new results visible mv $RESULTS $BASE/$PROJECT - # delete the old results - rm ${RESULTS}.tmp -r echo "$(date -u) - $REPRODUCIBLE_URL/$PROJECT has been updated." done } -- cgit v1.2.3-54-g00ecf