diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 16:53:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-01 16:53:22 +0200 |
commit | 406e1a2a4169c752f5f69df6b8f1b04102292976 (patch) | |
tree | e1fc9883eef4144133b0c406c23d6bc7e080e7eb | |
parent | 5f11de92eb5dcf6bff87be5b7f0989c429c4a2cc (diff) |
Update intro script to match the intro doc
-rwxr-xr-x | intro | 127 |
1 files changed, 84 insertions, 43 deletions
@@ -12,8 +12,9 @@ # -c1 # -c2 # -c3 -# C++ compilers 1 (g++-5), 2 (clang++-3.6), and 3 (x86_64-w64-mingw32-g++). -# If the value for 2 or 2 is empty, then this test is skipped. +# -c4 +# C++ compilers 1 (g++-5), 2 (clang++-3.6), 3 (x86_64-w64-mingw32-g++), and +# 4 (cl-14). If the value for 2, 3, 4 is empty, then this test is skipped. # # -h # The hello2 source directory, by default hello/hello2 @@ -21,6 +22,9 @@ # -s # Show the commands being executed. # +# -p +# Prompt for confirmations. +# # For example: # # intro https://pkg.cppget.org/1/hello @@ -39,10 +43,13 @@ rep= toolchain= hello2=hello/hello2 show=n +prompt=-y +trust="--trust FF:DF:7D:38:67:4E:C3:82:65:7E:EE:1F:D4:80:EC:56:C4:33:5B:65:3F:9B:29:9A:30:56:B9:77:B9:F2:01:94" c1=g++-5 c2=clang++-3.6 c3=x86_64-w64-mingw32-g++ +c4=cl-14 while [ $# -gt 0 ]; do case $1 in @@ -53,17 +60,22 @@ while [ $# -gt 0 ]; do ;; -c1) shift - c1=$1 + c1="$1" shift ;; -c2) shift - c2=$1 + c2="$1" shift ;; -c3) shift - c3=$1 + c3="$1" + shift + ;; + -c4) + shift + c4="$1" shift ;; -h) @@ -75,6 +87,11 @@ while [ $# -gt 0 ]; do show=y shift ;; + -p) + prompt= + trust= + shift + ;; *) rep=${1%/} break @@ -116,10 +133,10 @@ function show () # <cmd> ... { if [ $show = "y" ]; then echo "$*" - $* + "${@}" echo else - $* + "${@}" fi } @@ -130,13 +147,13 @@ function create () # <dir> <bpkg-args> rm -rf $tmp/$d mkdir $tmp/$d cd $tmp/$d - show bpkg create $* + show bpkg create "${@}" } function info () # stable|testing { local d=$1; shift - show bpkg rep-info $rep/$d + show bpkg rep-info $trust $rep/$d } function add () # stable|testing @@ -147,30 +164,35 @@ function add () # stable|testing function fetch () { - show bpkg fetch + show bpkg fetch $trust } function build () # <bpkg-args> { - show bpkg build -y $* + show bpkg build $prompt "${@}" } function drop () # <bpkg-args> { - show bpkg drop -y $* + show bpkg drop $prompt "${@}" } -function status () # <pkg> <expected> +function status () # <pkg> <expected> [<args>] { + local p="$1" + shift + local e="$1" + shift + if [ $show = "y" ]; then - echo "bpkg status $1" + echo "bpkg status $* $p" fi - local s=`bpkg status $1` + local s="$(bpkg status "${@}" $p)" echo "$s" - if [ "$s" != "$2" ]; then - error "status $1: '"$s"', expected: '"$2"'" + if [ "$s" != "$e" ]; then + error "status $1: '"$s"', expected: '"$e"'" fi if [ $show = "y" ]; then @@ -180,41 +202,50 @@ function status () # <pkg> <expected> function clean () # <bpk> { - show bpkg clean $* + show bpkg clean "${@}" } function update () # <bpk> { - show bpkg update $* + show bpkg update "${@}" } function test () # <bpk> { - show bpkg test $* + show bpkg test "${@}" } -create hello-gcc5-release cxx config.cxx=$c1 config.cxx.coptions=-O3 +create hello-gcc5-release cxx config.cxx="$c1" config.cxx.coptions=-O3 +if [ -n "$c2" ]; then + create hello-vc14-release cxx config.cxx="$c4" config.cxx.coptions=/O2 +fi +create hello-gcc5-release cc config.cxx="$c1" config.cc.coptions=-O3 + info stable add stable fetch build hello drop hello -build -v hello -status libhello "configured 1.0.1" -status hello "configured 1.0.0 hold_package" -drop hello -status hello "available 1.0.0" +build -v -y hello + +status libhello "configured 1.0.0; available sys:?" +status hello "configured 1.0.0 hold_package; available sys:?" +drop -y hello +status hello "available 1.0.0 sys:?" status libfoobar "unknown" -build hello + + + +build -y hello add testing fetch -status libhello "configured 1.0.1; available 1.1.1 1.1.0" -build hello +status libhello "configured 1.0.0; available 1.1.0 sys:?" +build -y hello build libhello clean hello update hello -build libhello/1.0.1 +build libhello/1.0.0 test libhello hello show ls -1F @@ -222,25 +253,35 @@ show ls -1F hello-1.0.0/ show hello-1.0.0/hello || true show hello-1.0.0/hello World -show bpkg install config.install.root=/opt/hello \ - config.install.root.sudo=sudo \ - config.bin.rpath=/opt/hello/lib hello +show bpkg install \ + config.install.root=/opt/hello \ + config.install.sudo=sudo \ + config.bin.rpath=/opt/hello/lib \ + hello show $tree -F /opt/hello/ show /opt/hello/bin/hello World -sudo rm -rf /opt/hello + +show bpkg uninstall \ + config.install.root=/opt/hello \ + config.install.sudo=sudo \ + config.bin.rpath=/opt/hello/lib \ + hello +show ls /opt/hello || true show cd $hello2 show b config.cxx=$c1 config.import.libhello=$tmp/hello-gcc5-release show $tree -F show ./hello -show b config.cxx=$c1 config.import.libhello=$tmp/hello-gcc5-release clean # Extra. +b config.cxx=$c1 config.import.libhello=$tmp/hello-gcc5-release clean # Extra. show cd $tmp rm -rf hello2-gcc5-release show mkdir hello2-gcc5-release -show b config.cxx=$c1 config.cxx.coptions=-O3 \ - config.import.libhello=$tmp/hello-gcc5-release \ - "configure($hello2/@hello2-gcc5-release/)" +show b config.cxx=$c1 \ + config.cc.coptions=-O3 \ + config.import.libhello=$tmp/hello-gcc5-release \ + "configure($hello2/@hello2-gcc5-release/)" + show b hello2-gcc5-release/ show cd hello2-gcc5-release/ show b @@ -250,6 +291,7 @@ show b -v show cd $tmp show b "configure($hello2/@$tmp/hello-gcc5-release/hello2/)" show b $tmp/hello-gcc5-release/hello2/ +status hello2 "unknown" -d $tmp/hello-gcc5-release show b "{clean disfigure}($tmp/hello-gcc5-release/hello2/)" build -d $tmp/hello-gcc5-release $hello2/ @@ -258,19 +300,18 @@ update -d $tmp/hello-gcc5-release hello2 show $tmp/hello-gcc5-release/hello2-1.0.0/hello if [ -n "$c2" ]; then - create hello-clang36-release cxx config.cxx=$c2 config.cxx.coptions=-O3 + create hello-clang36-release cc config.cxx=$c2 config.cc.coptions=-O3 add testing fetch build libhello/1.0.0 $hello2/ fi if [ -n "$c3" ]; then - create hello-mingw32 cxx \ - config.cxx=$c3 \ - config.bin.lib=static config.cxx.loptions=-static + create hello-mingw64 cc config.cxx=$c3 add stable fetch - build hello + build -y hello export WINEDEBUG=fixme-all show wine hello-1.0.0/hello.exe Windows + test libhello hello fi |