From fa59fd202ce7e9a85556a97810cef6639b11e779 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 28 Sep 2012 19:20:18 +0000 Subject: make it possible to use script to generate source tarballs locally, and not only on the server svn path=/trunk/; revision=16318 --- scripts/auto-build/pd-extended-source-tarball.sh | 41 +++++++++++++++++------- 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'scripts/auto-build/pd-extended-source-tarball.sh') 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 -- cgit v1.2.1