diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 17:27:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 17:27:31 +0200 |
commit | 017756f494ec95fc22bd3f43ef03e53834105674 (patch) | |
tree | d34b349c523129547825863ade98430b47bdc413 | |
parent | b80502d210428de4471cc8a642dcd19aaa60ef26 (diff) |
0.4.0 release updates0.4.0
-rwxr-xr-x | dist | 105 | ||||
-rwxr-xr-x | install | 252 | ||||
-rw-r--r-- | release-bugfix-only.txt (renamed from bugfix.txt) | 1 | ||||
-rw-r--r-- | release.txt | 304 | ||||
-rwxr-xr-x | test | 120 | ||||
-rwxr-xr-x | test-upgrade | 93 |
6 files changed, 207 insertions, 668 deletions
@@ -1,105 +0,0 @@ -#! /usr/bin/env bash - -# Prepare build2 distribution. -# -# Usage: dist [-t] [-s] -# -# -t -# Toolchain only. -# -# -s -# Skip checks. -# -usage="usage: $0 [-t] [-s]" - -owd=`pwd` -trap "{ cd $owd; exit 1; }" ERR -set -o errtrace # Trap in functions. - -function info () { echo "$*" 1>&2; } -function error () { info "$*"; exit 1; } - -toolchain="libbutl build2 libbpkg bpkg" -extras="brep" - -skip=n - -while [ $# -gt 0 ]; do - case $1 in - -t) - extras= - shift - ;; - -s) - skip=y - 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 - -if [ "$skip" != "y" ]; then - - # 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/ -fi - -# -# -mkdir -p build2-$v - -# Can pass additional list of archives to copy. -# -function dist() # <project> [<archive>...] -{ - local p=$1; shift - local pv=`cat $p/version` - - rm -f build2-$v/$p-$pv.* - b "dist($p-default/)" - - local f - local e - for e in $* tar.gz; do - f="$p-$pv.$e" - cp /tmp/$f build2-$v/ - cd build2-$v - sha256sum -b $f >$f.sha256 - cd .. - done - echo build2-$v/$f -} - -for t in $tools; do - f=`dist $t` - mkdir -p cppget.org/repository/1/queue/$t - cp $f cppget.org/repository/1/queue/$t/ -done - -dist build2-toolchain zip - -# Regenerate repository manifests. -# -cppget.org/update cppget.org/repository/1/queue - -cd $owd -info "distribution in build2-$v/" diff --git a/install b/install deleted file mode 100755 index 6ee6896..0000000 --- a/install +++ /dev/null @@ -1,252 +0,0 @@ -#! /usr/bin/env bash - -# Test installation of the build2 toolchain distribution. Essentially, this -# is an automated build2-toolchain/INSTALL. -# -# Usage: install [options] <build2-toolchain-archive> <build2-repo> -# -# -i <dir> -# Target installation directory instead of default /tmp/build2-install. -# -# -l <dir> -# Prerequisite library (libodb, libodb-sqlite) installation directory -# instead of default /usr/local. -# -# -s -# Use sudo when installing. -# -# -t -# Build and install toolchain only, no extras (brep). -# -# --cxx <path> -# C++ compiler to use, g++ by default. -# -# --cxxflags <flags> -# C++ compiler flags to use, -W -Wall -Wno-unknown-pragmas by default. -# -# --cppflags <flags> -# Extra C++ preprocessor flags to use. -# -# --bpkgflags <flags> -# Extra flags to pass to bpkg. -# -# For example: -# -# install /tmp/build2-toolchain-0.1.0.tar.gz https://pkg.cppget.org/1/alpha -# -usage="usage: $0 [options] <build2-toolchain-archive> <build2-repo>" - -owd=`pwd` -trap "{ cd $owd; exit 1; }" ERR -set -o errtrace # Trap in functions. - -function info () { echo "$*" 1>&2; } -function error () { info "$*"; exit 1; } - -tca= -rep= -tmp=/tmp -lib="/usr/local" # Library (libodb, etc) installation directory. -ins="$tmp/build2-install" # Our installation directory. -sudo= -extras=brep # Extras to build. -extras_show=brep-load # Extra programs (in bin/) to test with --version. -pmc="build2-toolchain" # bpkg configuration directory -cxx="g++" -cxxflags="-W -Wall -Wno-unknown-pragmas" -cppflags= -bpkgflags= - -while [ $# -gt 0 ]; do - case $1 in - -s) - sudo=sudo - shift - ;; - -i) - shift - ins=${1%/} - shift - ;; - -l) - shift - lib=${1%/} - shift - ;; - -t) - extras= - shift - ;; - --cxx) - shift - cxx=$1 - shift - ;; - --cxxflags) - shift - cxxflags="$1" - shift - ;; - --cppflags) - shift - cppflags="$1" - shift - ;; - --bpkgflags) - shift - bpkgflags="$1" - shift - ;; - *) - if [ -z "$tca" ]; then - tca=${1%/}; shift - else - rep=$1; break - fi - ;; - esac -done - -if [ -z "$tca" ]; then - error $usage -fi - -if [ -z "$rep" ]; then - error $usage -fi - -cd $tmp - -# Download archive if it is an HTTP URL. -# -if [[ $tca == http://* || $tca == https://* ]]; then - url=$tca - tca=`echo "$url" | sed -e 's%^.*/\(.*\)$%\1%' -` - if [ -z "$tca" ]; then - error "unable to extract archive name from $url" - fi - rm -f $tca - wget $url -elif [[ $tca != /* ]]; then - tca=$owd/$tca -fi - -if [[ $rep != http://* && $rep != https://* && $rep != /* ]]; then - rep=$owd/$rep -fi - -if [[ $ins != /* ]]; then - ins=$owd/$ins -fi - -# Warm sudo up so that the rest of this script can continue unattended. -# -if [ "$sudo" ]; then - $sudo echo >/dev/null -fi - -tcb=`basename $tca .tar.gz` - -# Remove installation directories so that any old stuff doesn't affect -# us due to rpath. -# -$sudo rm -rf $ins $ins-boot - -# Unpack. -# -rm -rf $tcb -rm -rf $tcb.disabled -tar xfz $tca - -# Bootstrap. -# -cd $tcb/build2 -./bootstrap --cxx $cxx --cxxflags "$cxxflags" -cd .. - -./build2/build2/b-boot \ - "!config.cxx=$cxx" \ - "!config.cxx.coptions=$cxxflags" \ - "!config.bin.rpath=$ins-boot/lib" build2/ - -./build2/build2/b \ - config.cxx=$cxx \ - config.cxx.coptions="$cxxflags" \ - config.cxx.poptions="$cppflags -I$lib/include" \ - config.cxx.loptions=-L$lib/lib \ - config.bin.rpath="$ins-boot/lib $lib/lib" \ - config.install.root=$ins-boot \ - config.install.root.sudo=$sudo \ - configure - -./build2/build2/b -./build2/build2/b install - -function show () # <dir> <prog>... -{ - local d=$1; shift - for p in $*; do - if [ "`which $p`" != "$d/bin/$p" ]; then - error "wrong $p path: `which $p`" - fi - - $p --version 1>&2 - done -} - -# Disable any rpaths that may still be pointing inside the build directory. -# -cd $tmp -mv $tcb $tcb.disabled - -OLDPATH="$PATH" -PATH="$ins-boot/bin:$OLDPATH" -show $ins-boot b bpkg - -# Rebuild via the package manager. -# -mkdir -p $pmc -rm -rf $pmc/* -rm -rf $pmc.disabled -cd $pmc - -bpkg $bpkgflags create \ - cxx \ - config.cxx=$cxx \ - config.cxx.coptions="$cxxflags" \ - config.cxx.poptions="$cppflags -I$lib/include" \ - config.cxx.loptions=-L$lib/lib \ - config.bin.rpath="$ins/lib $lib/lib" \ - config.install.root=$ins \ - config.install.root.sudo=$sudo \ - -bpkg $bpkgflags add $rep -bpkg $bpkgflags fetch -bpkg $bpkgflags build --yes build2 bpkg - -bpkg $bpkgflags install build2 bpkg - -cd $tmp -mv $pmc $pmc.disabled - -PATH="$ins/bin:$OLDPATH" -show $ins b bpkg - -mv $pmc.disabled $pmc - -# Build extras using the bpkg-built toolchain. -# -if [ ! -z "$extras" ]; then - cd $pmc - bpkg $bpkgflags build --yes $extras - bpkg $bpkgflags install $extras - cd $tmp - - mv $pmc $pmc.disabled - show $ins $extras_show - mv $pmc.disabled $pmc -fi - -mv $tcb.disabled $tcb - -cd $owd diff --git a/bugfix.txt b/release-bugfix-only.txt index db67c84..7b7f44f 100644 --- a/bugfix.txt +++ b/release-bugfix-only.txt @@ -1,3 +1,4 @@ +@@ Probably outdated (compare to release.txt). - See if makes sense to cherry-pick other fixes/changes diff --git a/release.txt b/release.txt index cd133a5..ad06109 100644 --- a/release.txt +++ b/release.txt @@ -1,14 +1,12 @@ TODO ==== -@@ Local Clang test is broken and disabled, using FreeBSD for Clang testing +@@ No upgrade testing (see old test-upgrade script). -Notes -===== - -* Be very careful with submodules if fixing anything, remember to update - build2-toolchain. +@@ Not saving in previous toolchains (see old install script). +@@ Using FreeBSD for Clang/libc++ testing, both 3.4 (earliest we support) + and 3.7. Setup ===== @@ -21,44 +19,214 @@ Setup For Mac OS: echo "boris ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers -- Boot cppget1, freebsd VMs, make sure data/time is correct. +- Boot freebsd VM, make sure data/time is correct. + +Notes +===== + +* Be very careful with submodules if fixing anything, remember to update + build2-toolchain. + +* Be very carefult with regenerating documentation, ODB files, both in + individual projects and build2-toolchain. + +Stage +===== + +- To stage build2 + + ~ make sure build2-toolchain is ready (submodules, doc/odb regen) + ~ update BUILD2_REPO URL in build2-toolchain/build* scripts if needed + + To stage to stage.build2.org: + + ~ to exclude baseutils/mingw, add -p + + etc/stage + + To stage to cppget.org/queue: + + ~ note: assuming brep running on queue can handle it + + etc/stage -q + +- To stage hello + + cd hello + ./stat + ./stage + + To run intro on staged: + + etc/intro -s https://build2.org/pkg/1/stage + +Test : + + + Local with cli disables + + + Local with Intel icc + ~ fails with ICE on build2 + + + Local with gcc 4.8 -+ Copy prerequisites into build2-X.Y/, generate sha256 sums in BINARY (-b) + + Local brep build: -+ Build new prerequisites (if any) on local, freebsd (install to /usr/local). + bpkg create -d brep cc config.cc.poptions="-I$(apxs -q includedir)" + cd brep + bpkg add https://stage.build2.org/1 + bpkg fetch + bpkg build brep ?sys:libapr1 ?sys:libpq -+ If new preprequisites/version, need to update manifests. +Cross: + + + Test VC cross-build + + + Test MinGW cross-build (build2 build fails on GC 4.8.2, using ODB cross) + + +Bootstrap (with upgrade procedures): + + + CentOS GCC 4.8 + + + FreeBSD 10 Clang 3.4 (clang++) + + + FreeBSD 10 Clang 3.7 (clang++37) with -W -Wall (mod build.sh) + brep: + + bpkg create -d brep cc config.cxx=clang++37 \ + config.cc.poptions="-I$(apxs -q includedir)" + cd brep + bpkg add https://stage.build2.org/1 + bpkg fetch + bpkg build brep ?sys:libapr1 ?sys:libpq + + + Windows7-64 VC14u2 + + + WindowsXP-32 MinGW (build2-mingw) + + + Windows MSYS2 + + + Mac OS Xcode/Clang (and g++ alias) + +Upgrade brep on stage Prelude ======= -+ Remove etc/ from modules in etc/git/modules. ++ Remove etc/, build2-toolchain from modules in etc/git/modules. + Review '@@' items [note: etc, private excluded] etc/review | less -R -+ Need to make sure Intro is still accurate wrt output, etc. Use -s switch - to etc/intro to compare: ++ Make sure Intro is still accurate wrt output, etc. Use -s -p switches to + etc/intro to compare (after running hello/stage): etc/intro -s `pwd`/hello/repository/1/ ++ If new preprequisites/version, need to update manifests. See + private/build2-projects.txt to review. + + Increment version to final. - * Need to update versions/dates for man generation (cli.sh in build2, - bpkg, brep, and built2-toolchain). + ~ update and use etc/version script - * Review manifests for any other changes (new entries/files, etc). + ~ update versions/dates for man generation (cli.sh in build2, bpkg, brep, + and built2-toolchain) + ++ Update BUILD2_REPO URL in build2-toolchain/build* scripts to alpha, also + grep docs for 'stage.' in case got copied. + Close schema versions, review schema changlog difference from previous release (tag) for any data migration that may be required (@@ would also need to test this; see upgrade test). -+ Need to update submodules? Remember to push first. ++ Update NEWS files. + ++ Need to update submodules? (remember to push first) + ++ Need to regenerate ODB files, CLI documentation, in build2-toolchin? + +Procession +========== + ++ Stage final packages (remove -p if need baseutils/mingw) + + etc/stage -p + +- Upgrade brep on lists.build2, lists.cppget from stage + + ~ assumming it can handle old repositories (should normally be the case) + + ~ backup config if changed + + cd private/ + scp -r lists.build2.org:/home/brep/config lists.build2.org/home/brep/ + scp -r lists.cppget.org:/home/brep/config lists.cppget.org/home/brep/ + + ~ note: on cppget we have queue: + + install/bin/brep-migrate -n brep_queue + install/bin/brep-load -n brep_queue config/brep-queue-load.conf + ++ Queue final packages + + etc/stage -p -q + ++ Smoke-test any last-minute changes -+ Need to regenerate ODB files, CLI documentation, in build2-toolchin! ++ Move packages from queue to alpha, cleanup obsolete, regenerate. -+ Update everything: + cd cppget.org + git -C repository status + ./update + ++ Publish to production (build2.org/cppget.org) + + etc/publish + ++ Smoke-test + ++ Publish hello repository + + cd hello + ./stage -p + + Test intro steps: + + etc/intro -s https://build2.org/pkg/1/hello + +- Commit and push git repositories: + ++ ~ cppget.org (commit individually and push) + + ~ hello project and respository (add & commit individual packages) + + cd hello + ./foreach-git stat + + ./foreach-git -x libhello-1.0 tag -a build2-X.Y -m "Tag for build2 version X.Y" + git -C libhello-1.0 tag -a 1.0/build2-X.Y -m "Tag for build2 version X.Y" + ./foreach-git push --tags + ++ Tag (review tag_modules) and push. + + etc/tag + ./push.sh + +- Tag and increment version for each published package (see + private/build2-projects.txt) + +============================================================================= + +@@ When copying to production need to make sure we don't override existing + versions of prerequisite packages that haven't changed (but which we still + stage/queue). + +============================================================================= + +@@ Move up. + +- Update everything: b libbutl/ build2/ libbpkg/ bpkg/ brep/ build2-toolchain-default/ @@ -74,24 +242,6 @@ Prelude ./test.sh -v --remote --fetch fetch --fetch-option --no-verify-peer \ --tar bsdtar --sha256 sha256-freebsd - * Update cppget repository (existing packages, not publishing yet): - - @@ What is the purpose of this step? It will mess up upgrade test - below. - - -t /home/boris/work/build2/etc1/install/0.2.0 -e queue - - cd cppget.org - git -C repository status - ./update repository/1/ - - This might not work in the early stage (backwards-incompatible) - - ./test -c cxx \ - -c config.cxx.loptions=-L/usr/local/lib \ - -c config.cxx.poptions="-I/usr/include/apache2 -I/usr/include/apr-1.0" \ - repository/1/ - * Test dev integration of brep/ on hello and cppget repos First check if Apache2 configuration needs updating (INSTALL-DEV). Then @@ -114,54 +264,33 @@ Prelude Procession ========== -- Generate distribution (use -t for toolchain-only, without brep). The +X Generate distribution (use -t for toolchain-only, without brep). The result is placed into the queue. etc/dist 2>&1 | tee dist.log -- @@ Would be nice to test packages for missing files, etc., before upgrade. - -- Test upgrade from previous version (replace Y in 0.Y.0). +X Test upgrade from previous version (replace Y in 0.Y.0). etc/test-upgrade -c cxx \ -c config.cxx.loptions=-L/usr/local/lib \ -c config.cxx.poptions="-I/usr/include/apache2 -I/usr/include/apr-1.0" \ /home/boris/work/build2/etc1/install/0.Y.0 -- Update and test hello repository +X Update and test hello repository cd hello - for d in hello libhello libprint libformat repository; do \ - git -C $d status; done - ./release -a + ./foreach-git status + ./stage -p -- Test Intro steps on the local hello repository +X Test Intro steps on the local hello repository etc/intro `pwd`/hello/repository/1/ -- Publish hello repository, commit but don't push. - - [We need to publish now because etc/test uses it.] - - @@ Ideally we would want to stage it. - - ./release -p - -- Test Intro steps on the remote hello repository - - etc/intro https://build2.org/pkg/1/hello/ - -- Stage queue to cppget.org +X Stage queue to cppget.org etc/stage --dry-run etc/stage -- Regenerate other cppget.org sections with the new toolchain - - cd cppget.org - git -C repository status - ./update -e queue repository/1/ - - Determine the earliest supported backwards-compatible toolchain (see requires: in manifests), update etc/test @@ -170,21 +299,6 @@ Procession etc/test 2>&1 | tee test.log grep -i warning test.log -- Upgrade brep on build2.org (via package/queue upgrade if possible), - verify works. - - Backup configs if changed: - - cd private/ - scp -r lists.build2.org:/home/brep/config lists.build2.org/home/brep/ - -- Move packages from queue to alpha, regenerate repositories. - - ./update repository/1/ - -- Publish to production (build2.org/cppget.org). - - etc/publish - Test production and save a copy of toolchain in etc1/install/X.Y.Z @@ -205,51 +319,45 @@ Procession cd private/ scp -r lists.cppget.org:/home/brep/config lists.cppget.org/home/brep/ -- Tag (review tag_modules) - - etc/tag - ./push.sh - -- Commit and push cppget.org, hello git repositories - Release ======= -- Update style/ submodule in private/ ++ Update style/ submodule in private/ -- Write release notes, use placeholder for announcement URL. Add link to ++ Write release notes, use placeholder for announcement URL. Add link from the doc page. - Any new FAQ entries or any other updates (main page, etc)? -- Update download page. ++ Update download page. -- Regenerate (./cli.sh) all hosts. ++ Regenerate (./cli.sh) all hosts. -- Test local, publish, test production: ++ Test local, publish, test production: cd private/ ./publish --dry-run ./publish -- Write and send announcements ++ Write and send announcements Remember upgrade instructions. cat `ls -1 *.sha256` -- Patch the announcement URL in release notes, re-publish. ++ Patch the announcement URL in release notes, re-publish. - Announce on reddit and other places (doc/ann). Postlude ======== -- Need to regenerate/republish hello/ repository? - - Increment and open schema versions. Maybe not. Maybe we should only do that when there is a model change. -- Increment project versions to alpha1, open master for business ++ Increment project versions to alpha1, change BUILD2_REPO to staging, + open master for business. + +- Commit changes to etc/, add it back to etc/git/modules, and tag: -- Commit changes to etc/, add it back to etc/git/modules. + git tag -a X.Y.Z -m "Tag version X.Y.Z" @@ -1,120 +0,0 @@ -#! /usr/bin/env bash - -# Test build2 distribution. -# -# Usage: test -# -usage="usage: $0" - -owd=`pwd` -trap "{ cd $owd; exit 1; }" ERR -set -o errtrace # Trap in functions. - -function info () { echo "$*" 1>&2; } -function error () { info "$*"; exit 1; } - -# Calculate versions. -# -tcv=`cat build2-toolchain/version` -v=`echo $tcv | sed -e 's/^\(.*\)\.\(.*\)\..*$/\1.\2/' -` - -if [ -z "$v" ]; then - error "unable to extract version from `cat build2-toolchain/version`" -fi - -src=build2-$v - -#if false; then - -# Update the development build. -# -info "making sure everythings is up to date..." -b build2/ bpkg/ - - -# Test queue with the earliest and latest (as development build via -# /usr/local links) toolchains. -# -for t in etc1/install/0.2.0 /usr/local; do - cppget.org/test -t $t \ --c cxx \ --c config.cxx.coptions="-W -Wall -Wno-unknown-pragmas" \ --c config.cxx.poptions="-I/usr/include/apache2 -I/usr/include/apr-1.0" \ --c config.cxx.loptions=-L/usr/local/lib \ -cppget.org/repository/1/queue/ -done - -# Test the build2-toolchain INSTALL procedure (plus brep) with the earliest -# compiler versions we claim to support and the latest available. -# -# Note: Clang 3.4 and 3.7 are tested on FreeBSD below (3.4 cannot coexist -# with newer versions on Ubuntu). -# -for c in g++-4.8 g++-4.9 g++-5; do - etc/install \ ---cxx $c \ ---cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \ -$src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget.org/1/queue -done - -# This doesn't work since libodb, etc are using libstdc++. -# -if false; then -for c in clang++-3.5 clang++-3.6; do - etc/install \ ---cxx $c \ ---cppflags "-I/usr/include/apache2 -I/usr/include/apr-1.0" \ ---cxxflags --stdlib=libc++ \ -$src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget.org/1/queue -done -fi - -# Test installation requiring sudo. -# -etc/install -t -i /opt/build2 -s $src/build2-toolchain-$tcv.tar.gz \ -https://pkg.cppget.org/1/queue - -# Test on FreeBSD with Clang 3.4 (default) and Clang 3.7. -# -scp etc/install $src/build2-toolchain-$tcv.tar.gz freebsd:/tmp/ - -for c in clang++ clang++37; do - ssh freebsd cd /tmp ';' ./install \ ---cxx $c \ ---cppflags '"-I/usr/local/include/apr-1 -I/usr/local/include/apache24"' \ -build2-toolchain-$tcv.tar.gz https://pkg.cppget.org/1/queue -done - -# Also run the Intro steps based on the toolchain we just built. -# -scp -r hello/hello2 etc/intro freebsd:/tmp/ - -ssh freebsd cd /tmp ';' ./intro \ --t /tmp/build2-install \ --c1 clang++37 \ --c2 clang++ \ --c3 "''" \ --h /tmp/hello2 \ -https://build2.org/pkg/1/hello/ - - -# Test on Mac OS (no brep). -# -scp etc/install $src/build2-toolchain-$tcv.tar.gz rbook:/tmp/ - -ssh rbook cd /tmp ';' ./install -t --cxx clang++ \ - build2-toolchain-$tcv.tar.gz https://pkg.cppget.org/1/queue - -# Again, run the Intro steps based on the toolchain we just built. -# -scp -r hello/hello2 etc/intro rbook:/tmp/ - -ssh rbook cd /tmp ';' ./intro \ --t /tmp/build2-install \ --c1 clang++ \ --c2 "''" \ --c3 "''" \ --h /tmp/hello2 \ -https://build2.org/pkg/1/hello/ diff --git a/test-upgrade b/test-upgrade deleted file mode 100755 index 29705da..0000000 --- a/test-upgrade +++ /dev/null @@ -1,93 +0,0 @@ -#! /usr/bin/env bash - -# Test build2 toolchain (and brep) upgrade. The old packages come from -# cppget.org/alpha and the new ones from cppget.org/queue. Run from build2/ -# root. -# -# Usage: test-upgrade [options] <old-toolchain> -# -# -c <option>|<module>|<var> -# Specify additional options, modules, or configuration variables to pass -# to the bpkg create command. For example: -# -usage="usage: $0 -t <old-toolchain>" - -owd=`pwd` -trap "{ cd $owd; exit 1; }" ERR -set -o errtrace # Trap in functions. - -function info () { echo "$*" 1>&2; } -function error () { info "$*"; exit 1; } - -cfg=/tmp/upgrade-cfg -ins=/tmp/upgrade-install -toolchain= -co=() # Use a bash array to handle arguments with spaces (say "-Ifoo -Ibar"). - -while [ $# -gt 0 ]; do - case $1 in - -c) - shift - co=("${co[@]}" "$1") - shift - ;; - *) - toolchain=${1%/} - shift - break - ;; - esac -done - -if [ -z "$toolchain" ]; then - error $usage -fi - -ob="$toolchain/bin/b" -if [ ! -x $ob ]; then - error "$ob does not exist or is not executable" -fi -obo="--build $ob" - -obpkg="$toolchain/bin/bpkg" -if [ ! -x $obpkg ]; then - error "$obpkg does not exist or is not executable" -fi - -# First create the configuration and build old packages using the old -# toolchain. -# -$obpkg $obo create -d $cfg --wipe "${co[@]}" -$obpkg add -d $cfg cppget.org/repository/1/alpha -$obpkg fetch -d $cfg -$obpkg $obo build -d $cfg --yes build2 bpkg brep - -# Now upgrade to new packages but still using the old toolchain. -# -$obpkg add -d $cfg cppget.org/repository/1/queue -$obpkg fetch -d $cfg -$obpkg $obo build -d $cfg --yes build2 bpkg brep - -# Install the new packages still using the old toolchain. -# -$obpkg $obo install -d $cfg config.install.root=$ins \ - config.bin.rpath=$ins/lib build2 bpkg brep - -$ins/bin/b --version 1>&2 -$ins/bin/bpkg --version 1>&2 -$ins/bin/brep-load --version 1>&2 - -# Check the use of the new toolchain on the old configuration. -# -nb="$ins/bin/b" -nbo="--build $nb" -nbpkg="$ins/bin/bpkg" - -$nbpkg $nbo clean -d $cfg build2 bpkg brep -$nbpkg $nbo build -d $cfg --yes build2 bpkg brep -$nbpkg $nbo install -d $cfg config.install.root=$ins \ - config.bin.rpath=$ins/lib build2 bpkg brep - -$ins/bin/b --version 1>&2 -$ins/bin/bpkg --version 1>&2 -$ins/bin/brep-load --version 1>&2 |