versionCheckHook: emit warning when falling back to pname

+5
+5
pkgs/by-name/ve/versionCheckHook/hook.sh
··· 43 43 elif [[ ! -z "${NIX_MAIN_PROGRAM-}" ]]; then 44 44 cmdProgram="${!outputBin}/bin/${NIX_MAIN_PROGRAM}" 45 45 elif [[ ! -z "${pname-}" ]]; then 46 + echo "versionCheckHook: Package \`${pname}\` does not have the \`meta.mainProgram\` attribute." \ 47 + "We'll assume that the main program has the same name for now, but this behavior is deprecated," \ 48 + "because it leads to surprising errors when the assumption does not hold." \ 49 + "If the package has a main program, please set \`meta.mainProgram\` in its definition to make this warning go away." \ 50 + "Should the binary that outputs the intended version differ from \`meta.mainProgram\`, consider setting \`versionCheckProgram\` instead." >&2 46 51 cmdProgram="${!outputBin}/bin/${pname}" 47 52 else 48 53 echo "versionCheckHook: \$NIX_MAIN_PROGRAM, \$versionCheckProgram and \$pname are all empty, so" \