blob: 1d218f573a34fb1e9fb93c9aa0b16a62931b72c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#! /usr/bin/env bash
# Publish build2 to build2.org/cppget.org (and brep.cppget.org).
#
# The distribution is taken from cppget.org/0/ and packages from
# cppget.org/repository/.
#
# Usage: publish [<rsync-options>]
#
usage="$0 [<rsync-options>]"
owd=`pwd`
trap "{ cd $owd; exit 1; }" ERR
set -o errtrace # Trap in functions.
function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }
v="$(sed -n -re 's/^version: ([^.]+\.[^.]+\.[^-]+(-[ab]\.[^.+]+)?).*$/\1/p' build2-toolchain/manifest)"
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 \
"${@}" "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/ "${@}"
info "brep.cppget.org:"
etc/rep-publish cppget.org/repository/1/ brep.cppget.org:/var/bpkg/1/ \
"${@}"
}
sync --dry-run "${@}"
r=
while [ -z "$r" ]; do
read -r -p "Continue? [yes/no]: " r
case "$r" in
yes) ;;
no) exit 0 ;;
*) r= ;;
esac
done
sync --progress "${@}"
|