Merge pull request #335142 from doronbehar/pkg/versionCheckHook
versionCheckHook: ignore echoed store paths
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
_handleCmdOutput(){
|
||||
local versionOutput
|
||||
versionOutput="$(env --chdir=/ --argv0="$(basename "$1")" --ignore-environment "$@" 2>&1 || true)"
|
||||
versionOutput="$(env \
|
||||
--chdir=/ \
|
||||
--argv0="$(basename "$1")" \
|
||||
--ignore-environment \
|
||||
"$@" 2>&1 \
|
||||
| sed -e 's|@storeDir@/[^/ ]*/|{{storeDir}}/|g' \
|
||||
|| true)"
|
||||
if [[ "$versionOutput" =~ "$version" ]]; then
|
||||
echoPrefix="Successfully managed to"
|
||||
else
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
makeSetupHook {
|
||||
name = "version-check-hook";
|
||||
substitutions = {
|
||||
storeDir = builtins.storeDir;
|
||||
};
|
||||
meta = {
|
||||
description = "Lookup for $version in the output of --help and --version";
|
||||
maintainers = with lib.maintainers; [ doronbehar ];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
libxml2,
|
||||
libffi,
|
||||
xar,
|
||||
testers,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
llvmPackages.stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -48,9 +48,8 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
version = testers.testVersion { package = finalAttrs.finalPackage; };
|
||||
};
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
doInstallCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Compiler for the C3 language";
|
||||
|
||||
Reference in New Issue
Block a user