. "$BST_LIB" # makeself 2.5.0, part 1 of 5 — the shipped PAYLOAD, the OPTION surface, and the # undeclared runtime dependencies. Creates no archive, so it is the cheap part # and reports even on a boot that is already under pressure. It is numbered 1 so # it runs FIRST: the runner takes tests/*.test in filename order and the whole # makeself surface shares one boot, so the cases that can always answer go ahead # of the ones that compete for a budget (see part 2's header). # # Two contracts here are not guesses and would each have shipped a false red if # written from expectation: # * makeself.sh exits 1 for --help, for no arguments, and for an unknown option # -- only --version exits 0. A suite asserting the usual "help is success" # would go red against a correct tool. That is why the local check_msg below # exists: bst.sh's check_out also demands rc 0. # * makeself-header.sh is a TEMPLATE, not a command: its first line is # `cat << EOF > "$archname"` and it carries no #! line, even though the # recipe installs it mode 0755 beside makeself.sh. It is half the port, not a # doc file -- makeself.sh finds it as `dirname $0`/makeself-header.sh -- so # the pairing is asserted rather than its runnability. require makeself.sh makeself/present MS=/usr/bin/makeself.sh HDR=/usr/bin/makeself-header.sh LC_ALL=C; export LC_ALL # ok iff 's combined output contains , WHATEVER its exit status. check_msg() { _mid=$1; _mneedle=$2; shift 2 _mout=$("$@" 2>&1) case "$_mout" in *"$_mneedle"*) bst_ok "$_mid" ;; *) bst_notok "$_mid" "want:'$_mneedle' got:'$(_bst_1line "$_mout")'" ;; esac } # --- shipped payload ------------------------------------------------------- check makeself/bin-present test -f "$MS" check makeself/bin-executable test -x "$MS" check makeself/header-present test -f "$HDR" check makeself/header-same-dir test -f "$(dirname "$MS")/makeself-header.sh" # Both halves are /bin/sh text, not compiled objects -- this is the only port in # the image that ships no wasm module at all. check_out makeself/bin-is-shell "#!/bin/sh" head -1 "$MS" # The header is a template fragment: it must NOT begin with a shebang. _h1=$(head -1 "$HDR" 2>&1) case "$_h1" in "#!"*) bst_notok makeself/header-is-template "header starts with a shebang: $(_bst_1line "$_h1")" ;; *) bst_ok makeself/header-is-template ;; esac # dpkg registration: the package is exactly these two files. check_out makeself/pkg-installed "/usr/bin/makeself.sh" cat /var/lib/dpkg/info/makeself.list check_out makeself/pkg-header-listed "/usr/bin/makeself-header.sh" cat /var/lib/dpkg/info/makeself.list # --- option surface -------------------------------------------------------- # Version is reported by the script's own MS_VERSION, so it tracks the recipe. check_out makeself/version "Makeself version 2.5.0" "$MS" --version check_rc makeself/version-rc 0 "$MS" --version check_rc makeself/version-short 0 "$MS" -v check_msg makeself/help-text "Usage:" "$MS" --help check_rc makeself/help-rc 1 "$MS" --help check_rc makeself/noargs-rc 1 "$MS" check_rc makeself/bogus-opt-rc 1 "$MS" --no-such-option # The usage banner names the four positional arguments, in order. check_msg makeself/usage-args "archive_dir file_name label startup_script" "$MS" --help # --- undeclared runtime dependencies --------------------------------------- # The recipe declares NO RDEPENDS, yet makeself refuses to start without a # compressor ("ERROR: missing commands: gzip, compress") and cannot build or # unpack an archive without tar and the coreutils checksum/split tools. They ship # in this image already, so the dependency is satisfied incidentally rather than # declared -- these cases are what would catch that changing. check makeself/dep-gzip command -v gzip check makeself/dep-tar command -v tar check makeself/dep-dd command -v dd check makeself/dep-md5sum command -v md5sum check makeself/dep-cksum command -v cksum check makeself/dep-xargs command -v xargs check makeself/dep-find command -v find check makeself/dep-awk command -v awk check makeself/dep-sed command -v sed check makeself/dep-du command -v du