summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2020-05-07 23:34:20 +0100
committerRobert Scott <code@humanleg.org.uk>2020-08-23 14:08:03 +0100
commitb91ad4289615209f0ea2030eda08290ada494f7c (patch)
treed860293fb81f8e12776cfd6e22b72d435e8a3410 /pkgs/applications
parent6b1e2a51aad506a559efbf16c9d83f7712b8a4a5 (diff)
downloadnixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar.gz
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar.bz2
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar.lz
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar.xz
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.tar.zst
nixpkgs-b91ad4289615209f0ea2030eda08290ada494f7c.zip
gitAndTools.git-fast-export: add installCheckPhase
this creates and converts a simple hg repository - should stop us
inadvertently breaking this package.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/version-management/git-and-tools/fast-export/default.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/fast-export/default.nix b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
index 2134b617c28..80f048d0575 100644
--- a/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
@@ -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";