aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-09-28 19:20:18 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-09-28 19:20:18 +0000
commitfa59fd202ce7e9a85556a97810cef6639b11e779 (patch)
treedfdf434628022f1ef9d4b379eae3bac8894e4565 /scripts
parentb8f5a447a18ea396c3964aace28acbfacbee0de8 (diff)
make it possible to use script to generate source tarballs locally, and not only on the server
svn path=/trunk/; revision=16318
Diffstat (limited to 'scripts')
-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