gitAndTools.git-fast-export: add installCheckPhase

this creates and converts a simple hg repository - should stop us
inadvertently breaking this package.
This commit is contained in:
Robert Scott 2020-05-07 23:34:20 +01:00
parent 6b1e2a51aa
commit b91ad42896

View File

@ -33,6 +33,29 @@ stdenv.mkDerivation rec {
done
'';
doInstallCheck = true;
# deliberately not adding git or hg into installCheckInputs - package should
# be able to work without them in runtime env
installCheckPhase = ''
mkdir repo-hg
pushd repo-hg
${mercurial}/bin/hg init
echo foo > bar
${mercurial}/bin/hg add bar
${mercurial}/bin/hg commit --message "baz"
popd
mkdir repo-git
pushd repo-git
${git}/bin/git init
${git}/bin/git config core.ignoreCase false # for darwin
$out/bin/hg-fast-export.sh -r ../repo-hg/ --hg-hash
for s in "foo" "bar" "baz" ; do
(${git}/bin/git show | grep $s > /dev/null) && echo $s found
done
popd
'';
meta = with stdenv.lib; {
description = "Import mercurial into git";
homepage = "https://repo.or.cz/w/fast-export.git";