diff options
-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 "${@}" |