From e38a11dc404b57371b7adcb1731b4cb40f44f037 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 1 Oct 2016 17:01:52 +0200 Subject: Update publish script --- publish | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/publish b/publish index 6bcd969..6e14b96 100755 --- a/publish +++ b/publish @@ -2,9 +2,12 @@ # Publish build2 to build2.org/cppget.org (and brep.cppget.org). # -# Usage: publish [] [] +# The distribution is taken from staging/0/ and packages from +# cppget.org/repository/. # -usage="$0 [] []" +# Usage: publish [] +# +usage="$0 []" 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 "${@}" -- cgit v1.1