diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-20 10:21:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-20 10:21:57 +0200 |
commit | c7aed7b90e4f306afb1b09664de0c1e70b962f26 (patch) | |
tree | c3c1be6d4b0409b4ae693ee101933437e814dfbe /dist | |
parent | db4f4539ac99eb18bad72a184964398919b25d6d (diff) |
Add release scripts, doc
Diffstat (limited to 'dist')
-rwxr-xr-x | dist | 84 |
1 files changed, 84 insertions, 0 deletions
@@ -0,0 +1,84 @@ +#! /usr/bin/env bash + +# Prepare build2 distribution. +# +# Usage: dist [-t] +# +# -t +# Toolchain only. +# +usage="usage: $0 [-t]" + +owd=`pwd` +trap "{ cd $owd; exit 1; }" ERR + +function info () { echo "$*" 1>&2; } +function error () { info "$*"; exit 1; } + +toolchain="libbutl build2 libbpkg bpkg" +extras="brep" + +while [ $# -gt 0 ]; do + case $1 in + -t) + extras= + shift + ;; + *) + error "unexpected $1" + ;; + esac +done + +tools="$toolchain $extras" + +v=`sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/' build2-toolchain/version` + +if [ -z "$v" ]; then + error "unable to extract version from `cat build2-toolchain/version`" +fi + +# Check that everything is committed and pushed. +# +info "checking repositories..." +for t in $tools build2-toolchain; do + git/check --master --clean --synced --submodule $t +done + +# Update the development build since we use it to dist/package. +# +info "making sure everythings is up to date..." +b build2/ bpkg/ + +# +# +mkdir -p build2-$v + +function dist() +{ + local p=$1; shift + local pv=`cat $p/version` + local f="$p-$pv.tar.gz" + b "dist($p-default/)" + rm -f build2-$v/$p-$pv.* + cp /tmp/$f build2-$v/ + cd build2-$v + sha256sum -b $f >$f.sha256 + cd .. + echo build2-$v/$f +} + +for t in $tools; do + f=`dist $t` + mkdir -p cppget.org/repository/1/alpha/$t + cp $f cppget.org/repository/1/alpha/$t/ +done + +dist build2-toolchain + +# Regenerate repository manifests. +# +cppget.org/update cppget.org/repository/1/ + +cd $owd +info "distribution in build2-$v/" |