summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
Diffstat (limited to 'publish')
-rwxr-xr-xpublish21
1 files changed, 9 insertions, 12 deletions
diff --git a/publish b/publish
index 6e14b96..1d218f5 100755
--- a/publish
+++ b/publish
@@ -2,7 +2,7 @@
# Publish build2 to build2.org/cppget.org (and brep.cppget.org).
#
-# The distribution is taken from staging/0/ and packages from
+# The distribution is taken from cppget.org/0/ and packages from
# cppget.org/repository/.
#
# Usage: publish [<rsync-options>]
@@ -16,24 +16,21 @@ set -o errtrace # Trap in functions.
function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }
-v="$(cat build2-toolchain/version)"
-vm="$(echo $v | sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/')" # X.Y
+v="$(sed -n -re 's/^version: ([^.]+\.[^.]+\.[^-]+(-[ab]\.[^.+]+)?).*$/\1/p' build2-toolchain/manifest)"
-if [ -z "$v" -o -z "$vm" ]; then
- error "unable to extract version from `cat build2-toolchain/version`"
-fi
-
-d="staging/0/$v"
-
-if [ ! -d "$d" ]; then
- error "distribution directory $d does not exist"
+if [ -z "$v" ]; then
+ error "unable to extract version build2-toolchain/manifest"
fi
function sync ()
{
info "build2.org:"
+
+ rsync -v -rlpt -c --copy-unsafe-links --prune-empty-dirs --delete-after \
+"${@}" "cppget.org/0/$v/" "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/"
+"${@}" "cppget.org/0/toolchain.sha256" "build2.org:/var/www/download.build2.org/public/"
info "cppget.org:"
etc/rep-publish cppget.org/repository/1/ cppget.org:/var/bpkg/1/ "${@}"