| 1 | #!/usr/bin/env bash
 | 
| 2 | #
 | 
| 3 | # Usage:
 | 
| 4 | #   test/spec-bin.sh <function name>
 | 
| 5 | 
 | 
| 6 | : ${LIB_OSH=stdlib/osh}
 | 
| 7 | source $LIB_OSH/bash-strict.sh
 | 
| 8 | source $LIB_OSH/task-five.sh
 | 
| 9 | 
 | 
| 10 | REPO_ROOT=$(cd "$(dirname $0)/.."; pwd)
 | 
| 11 | 
 | 
| 12 | #
 | 
| 13 | # "Non-hermetic"
 | 
| 14 | #
 | 
| 15 | 
 | 
| 16 | link-busybox-ash() {
 | 
| 17 |   ### Non-hermetic ash only used for benchmarks / Soil dev-minimal
 | 
| 18 | 
 | 
| 19 |   # Could delete this at some point
 | 
| 20 |   mkdir -p _tmp/shells
 | 
| 21 |   ln -s -f --verbose "$(which busybox)" _tmp/shells/ash
 | 
| 22 | }
 | 
| 23 | 
 | 
| 24 | # dash and bash should be there by default on Ubuntu.
 | 
| 25 | install-shells-with-apt() {
 | 
| 26 |   ### Non-hermetic shells; test/spec-bin.sh replaces this for most purposes
 | 
| 27 | 
 | 
| 28 |   set -x  # show what needs sudo
 | 
| 29 | 
 | 
| 30 |   # pass -y to install in an automated way
 | 
| 31 |   sudo apt "$@" install busybox-static mksh zsh
 | 
| 32 |   set +x
 | 
| 33 |   link-busybox-ash
 | 
| 34 | }
 | 
| 35 | 
 | 
| 36 | bash-upstream() {
 | 
| 37 |   wget --directory _tmp --no-clobber \
 | 
| 38 |     https://ftp.gnu.org/gnu/bash/bash-5.2.21.tar.gz
 | 
| 39 | }
 | 
| 40 | 
 | 
| 41 | task-five "$@"
 |