5 --argv0="$
(basename "$1")" \
8 | sed -e 's|@storeDir@/[^/ ]*/|{{storeDir}}/|g' \
10 if [[ "$versionOutput" =~
"$version" ]]; then
11 echoPrefix
="Successfully managed to"
15 # The return value of this function is this variable:
17 # And in anycase we want these to be printed in the build log, useful for
18 # debugging, so we print these to stderr.
19 echo "$echoPrefix" find version
"$version" in the output of the
command \
21 echo "$versionOutput" >&2
24 runHook preVersionCheck
25 echo Executing versionCheckPhase
27 local cmdProgram cmdArg echoPrefix
28 if [[ -z "${versionCheckProgram-}" ]]; then
29 if [[ -z "${pname-}" ]]; then
30 echo "both \$pname and \$versionCheckProgram are empty, so" \
31 "we don't know which program to run the versionCheckPhase" \
35 cmdProgram
="${!outputBin}/bin/$pname"
38 cmdProgram
="$versionCheckProgram"
40 if [[ ! -x "$cmdProgram" ]]; then
41 echo "versionCheckHook: $cmdProgram was not found, or is not an executable" >&2
44 if [[ -z "${versionCheckProgramArg}" ]]; then
45 for cmdArg
in "--help" "--version"; do
46 echoPrefix
="$(_handleCmdOutput "$cmdProgram" "$cmdArg")"
47 if [[ "$echoPrefix" == "Successfully managed to" ]]; then
52 cmdArg
="$versionCheckProgramArg"
53 echoPrefix
="$(_handleCmdOutput "$cmdProgram" "$cmdArg")"
55 if [[ "$echoPrefix" == "Did not" ]]; then
59 runHook postVersionCheck
60 echo Finished versionCheckPhase
63 if [[ -z "${dontVersionCheck-}" ]]; then
64 echo "Using versionCheckHook"
65 preInstallCheckHooks
+=(versionCheckHook
)