. "$BST_LIB" # makeself 2.5.0, part 3 of 5 — EXTRACT WITHOUT EXECUTING. Spends UNPACK #2 of # the three tar-decompressions the whole makeself surface can afford in one boot; # see part 2's header for the measured budget and why running tar through a # decompressor, not the clock, is the scarce resource, and # data/makeself-lib.sh for why the extraction is gated rather than asserted # outright. # # What it asserts: --noexec unpacks the payload but does NOT run the startup # script. Checking only that the files appeared would pass even if --noexec were # being ignored, so the run's output is also checked for the ABSENCE of the # startup script's marker. # # This is a separate file from the verify file (part 5) rather than a block in it # because the two together overran the runner's 60 s bound on target -- that file # emitted its integrity cases and was then cut off before the extraction, # reporting a suite-timeout instead of five results. require makeself.sh makeself/present . "$BST_DATA/makeself-lib.sh" # ms_gate / ms_needle / ms_check MS=/usr/bin/makeself.sh LC_ALL=C; export LC_ALL W=${TMPDIR:-/tmp}/bst-makeself-extract.$$ rm -rf "$W"; mkdir -p "$W/p/sub" || { bst_notok makeself/extract-setup "cannot create $W"; exit 0; } echo makeself-payload-marker > "$W/p/greeting.txt" echo nested > "$W/p/sub/nested.txt" printf '#!/bin/sh\necho MS-STARTUP-RAN\nexit 0\n' > "$W/p/startup.sh" chmod 755 "$W/p/startup.sh" cd "$W" || { bst_notok makeself/extract-setup "cannot cd $W"; exit 0; } A="$W/demo.run" "$MS" "$W/p" "$A" "BST Extract" ./startup.sh >/dev/null 2>&1 check makeself/extract-archive test -s "$A" # MSX, not _out: bst.sh's check* helpers assign _out internally, so a local named # _out is clobbered by the next check call and the path silently goes empty. MSX="$W/extracted" MSNE=$("$A" --noprogress --noexec --target "$MSX" 2>&1); MSNERC=$? ms_gate makeself/noexec-rc "$MSNERC" "$MSNE" ms_check makeself/noexec-file test -f "$MSX/greeting.txt" ms_check makeself/noexec-nested test -f "$MSX/sub/nested.txt" ms_check makeself/noexec-content grep -q makeself-payload-marker "$MSX/greeting.txt" # The absence assertion is meaningful whether or not the unpack happened -- an # extraction that failed also did not run the startup script -- so it is not # gated: it would be a real defect either way. case "$MSNE" in *MS-STARTUP-RAN*) bst_notok makeself/noexec-skips-startup "startup script ran under --noexec" ;; *) bst_ok makeself/noexec-skips-startup ;; esac cd / rm -rf "$W"