aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/auto-build/auto-build-common2
-rwxr-xr-xscripts/auto-build/pd-extended-source-tarball.sh41
2 files changed, 31 insertions, 12 deletions
diff --git a/scripts/auto-build/auto-build-common b/scripts/auto-build/auto-build-common
index e8376063..ebce7212 100644
--- a/scripts/auto-build/auto-build-common
+++ b/scripts/auto-build/auto-build-common
@@ -31,7 +31,9 @@ fi
if [ -e ${HOME}/auto-build-common.local ]; then
. ${HOME}/auto-build-common.local
+ running_on_server=yes
else
+ running_on_server=no
echo "Could not find local configuration in \"${HOME}/auto-build-common.local\""
echo "Skipping... (see ${HOME}/auto-build-common for instructions)"
echo
diff --git a/scripts/auto-build/pd-extended-source-tarball.sh b/scripts/auto-build/pd-extended-source-tarball.sh
index e006aec5..e69d14f2 100755
--- a/scripts/auto-build/pd-extended-source-tarball.sh
+++ b/scripts/auto-build/pd-extended-source-tarball.sh
@@ -1,7 +1,29 @@
#!/bin/sh
+# show each thing being executed
set -x
+# Any subsequent commands which fail will cause the shell script to exit
+set -e
+
+rsync_file()
+{
+ file=$1
+ file_upload=$(basename $file)
+ # if the rsync fails, ignore and carry on
+ (rsync -a ${file}.md5 rsync://${RSYNC_SERVER}/upload/${DATE}/${file_upload}.md5 && \
+ echo "successfully uploaded: ${file_upload}") || \
+ true
+}
+
+upload_generated_file()
+{
+ file=$1
+ rsync_file $file
+ md5sum ${file} > ${file}.md5
+ rsync_file $file.md5
+}
+
# the source dir where this script is
## this could be done more easily with ${0%/*}
SCRIPT_DIR=$(echo $0 | sed 's|\(.*\)/.*$|\1|')
@@ -18,16 +40,11 @@ $SCRIPT_DIR/pd-extended-auto-builder.sh source-tarball-only
version=$(get_pd_version $auto_build_root_dir)
source=`ls -1 /tmp/Pd-extended*$version*-source.tar.bz2 | tail -1`
+upload_generated_file $source
debian=`ls -1 /tmp/Pd-extended*$version*-source.debian.tar.bz2 | tail -1`
-source_upload=$(basename $source)
-debian_upload=$(basename $debian)
-rsync -a --chmod=a+r ${source} rsync://blinky.at.or.at/upload/${DATE}/${source_upload} && \
- md5sum ${source} > ${source}.md5 && \
- rsync -a ${source}.md5 rsync://blinky.at.or.at/upload/${DATE}/${source_upload}.md5 && \
- rsync -a --chmod=a+r ${debian} rsync://blinky.at.or.at/upload/${DATE}/${debian_upload} && \
- md5sum ${debian} > ${debian}.md5 && \
- rsync -a ${debian}.md5 rsync://blinky.at.or.at/upload/${DATE}/${debian_upload}.md5 && \
- rm $source && rm $source.md5 && \
- rm $debian && rm $debian.md5 && \
- echo "successfully uploaded: ${source_upload} and ${debian_upload}" && \
- echo SUCCESS
+upload_generated_file $debian
+if [ "$running_on_server" = "yes" ]; then
+ rm -f -- $source $source.md5
+ rm -f -- $debian $debian.md5
+fi
+echo SUCCESS