diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 17:01:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 17:01:52 +0200 |
commit | e38a11dc404b57371b7adcb1731b4cb40f44f037 (patch) | |
tree | 8dbf21330ac85f184e633acc32642dbe3e2c9903 /publish | |
parent | 8bb9d760b54f103fe1c6be67fde307666b81b789 (diff) |
Update publish script
Diffstat (limited to 'publish')
-rwxr-xr-x | publish | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -2,9 +2,12 @@ # Publish build2 to build2.org/cppget.org (and brep.cppget.org). # -# Usage: publish [<ver>] [<rsync-options>] +# The distribution is taken from staging/0/ and packages from +# cppget.org/repository/. # -usage="$0 [<ver>] [<rsync-options>]" +# Usage: publish [<rsync-options>] +# +usage="$0 [<rsync-options>]" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR @@ -13,18 +16,14 @@ set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } -if [[ $# -ne 0 && "$1" != -* ]]; then - v="$1" - shift -else - v=`sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/' build2-toolchain/version` -fi +v="$(cat build2-toolchain/version)" +vm="$(echo $v | sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/')" # X.Y -if [ -z "$v" ]; then +if [ -z "$v" -o -z "$vm" ]; then error "unable to extract version from `cat build2-toolchain/version`" fi -d="build2-$v" +d="staging/0/$v" if [ ! -d "$d" ]; then error "distribution directory $d does not exist" @@ -33,17 +32,18 @@ fi function sync () { info "build2.org:" - rsync -v -rlpt -c --copy-unsafe-links --prune-empty-dirs --delete-after $* \ -$d/ build2.org:/var/www/download.build2.org/public/$v/ + rsync -v -rlpt -c --copy-unsafe-links --prune-empty-dirs --delete-after \ +"${@}" "$d/" "build2.org:/var/www/download.build2.org/public/$vm/" info "cppget.org:" - cppget.org/publish cppget.org/repository/1/ cppget.org:/var/bpkg/1/ $* + etc/rep-publish cppget.org/repository/1/ cppget.org:/var/bpkg/1/ "${@}" info "brep.cppget.org:" - cppget.org/publish cppget.org/repository/1/ brep.cppget.org:/var/bpkg/1/ $* + etc/rep-publish cppget.org/repository/1/ brep.cppget.org:/var/bpkg/1/ \ +"${@}" } -sync --dry-run $* +sync --dry-run "${@}" r= while [ -z "$r" ]; do @@ -56,4 +56,4 @@ while [ -z "$r" ]; do esac done -sync --progress $* +sync --progress "${@}" |