#!/bin/bash # # Purpose : Helpers for HamPack's smoketest scenarios, on top of CoreDesktop's # smoketest/lib/scenario.sh. Scenarios source this. # hampack_file FILE: print HamPack's FILE at the commit under test hampack_file() { git -C "$(project_dir HamPack)" show "$(project_sha HamPack):$1" } # The apps in compile.conf at the commit under test, one per line compiled_apps() { hampack_file compile.conf | sed -n 's/^\[\(.*\)\]$/\1/p' } # compiled_version APP: APP's version= in compile.conf at the commit under test compiled_version() { hampack_file compile.conf | awk -v app="[$1]" ' $0 == app { found = 1; next } /^\[/ { found = 0 } found && /^version=/ { sub(/^version=/, ""); print; exit }' }