Merge pull request #335142 from doronbehar/pkg/versionCheckHook

versionCheckHook: ignore echoed store paths
This commit is contained in:
Peder Bergebakken Sundt
2024-08-19 02:12:56 +02:00
committed by GitHub
3 changed files with 13 additions and 5 deletions
+7 -1
View File
@@ -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 ];
+3 -4
View File
@@ -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";