nixBuild: add failurehook that saves build dir when succeedOnFailure = true and keepBuildDirectory = true

svn path=/nixpkgs/trunk/; revision=25243
This commit is contained in:
Rob Vermaas 2010-12-22 14:57:18 +00:00
parent dbd6382955
commit 6016038097

View File

@ -36,6 +36,18 @@ stdenv.mkDerivation (
cp $origSrc/nix-support/hydra-release-name $out/nix-support/hydra-release-name
fi
'';
failureHook = ''
if test -n "$succeedOnFailure"; then
if test -n "$keepBuildDirectory"; then
KEEPBUILDDIR="$out/`basename $TMPDIR`"
header "Copying build directory to $KEEPBUILDDIR"
ensureDir $KEEPBUILDDIR
cp -vR $TMPDIR/* $KEEPBUILDDIR
stopNest
fi
fi
'';
}
// args //