summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-20 10:21:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-20 10:21:57 +0200
commitc7aed7b90e4f306afb1b09664de0c1e70b962f26 (patch)
treec3c1be6d4b0409b4ae693ee101933437e814dfbe /dist
parentdb4f4539ac99eb18bad72a184964398919b25d6d (diff)
Add release scripts, doc
Diffstat (limited to 'dist')
-rwxr-xr-xdist84
1 files changed, 84 insertions, 0 deletions
diff --git a/dist b/dist
new file mode 100755
index 0000000..e06e7c2
--- /dev/null
+++ b/dist
@@ -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/"