| 1 | #!/usr/bin/env bash
 | 
| 2 | # 
 | 
| 3 | # Test release tarballs
 | 
| 4 | #
 | 
| 5 | # Usage:
 | 
| 6 | #   devtools/release-test.sh <function name>
 | 
| 7 | 
 | 
| 8 | set -o nounset
 | 
| 9 | set -o pipefail
 | 
| 10 | set -o errexit
 | 
| 11 | shopt -s strict:all 2>/dev/null || true  # dogfood for OSH
 | 
| 12 | 
 | 
| 13 | fetch() {
 | 
| 14 |   local dir=$1
 | 
| 15 |   local tar_url=$2
 | 
| 16 | 
 | 
| 17 |   wget --directory $dir --no-clobber $tar_url
 | 
| 18 | 
 | 
| 19 |   pushd $dir
 | 
| 20 |   tar -x -v < $(basename $tar_url)
 | 
| 21 |   popd
 | 
| 22 | }
 | 
| 23 | 
 | 
| 24 | fetch-2() {
 | 
| 25 |   fetch _tmp/release-test/github \
 | 
| 26 |     'http://travis-ci.oilshell.org/github-jobs/7098/cpp-tarball.wwz/_release/oils-for-unix.tar'
 | 
| 27 | 
 | 
| 28 |   fetch _tmp/release-test/sourcehut \
 | 
| 29 |     'http://travis-ci.oilshell.org/srht-jobs/1236802/cpp-tarball.wwz/_release/oils-for-unix.tar'
 | 
| 30 | }
 | 
| 31 | 
 | 
| 32 | diff-2() {
 | 
| 33 |   diff -u -r _tmp/release-test/{github,sourcehut}
 | 
| 34 | }
 | 
| 35 | 
 | 
| 36 | "$@"
 |