forked from mirrors/nixpkgs
fetchgitlocal: use output of git show
and git diff
to tell nix whether the source has changed.
this is way more hacky than i was hoping...
This commit is contained in:
parent
80c6c5e9ec
commit
bb363dd2f2
|
@ -1,6 +1,19 @@
|
||||||
{ runCommand, git }: src:
|
{ runCommand, git, nix }: src:
|
||||||
|
|
||||||
runCommand "local-git-export" {} ''
|
let hash = import (runCommand "head-hash.nix"
|
||||||
|
{ dummy = builtins.currentTime;
|
||||||
|
preferLocalBuild = true; }
|
||||||
|
''
|
||||||
|
cd ${toString src}
|
||||||
|
(${git}/bin/git show && ${git}/bin/git diff) > $out
|
||||||
|
hash=$(${nix}/bin/nix-hash $out)
|
||||||
|
echo "\"$hash\"" > $out
|
||||||
|
''); in
|
||||||
|
|
||||||
|
runCommand "local-git-export"
|
||||||
|
{ dummy = hash;
|
||||||
|
preferLocalBuild = true; }
|
||||||
|
''
|
||||||
cd ${toString src}
|
cd ${toString src}
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
for file in $(${git}/bin/git ls-files); do
|
for file in $(${git}/bin/git ls-files); do
|
||||||
|
|
|
@ -330,7 +330,7 @@ let
|
||||||
fetchgitrevision = import ../build-support/fetchgitrevision runCommand git;
|
fetchgitrevision = import ../build-support/fetchgitrevision runCommand git;
|
||||||
|
|
||||||
fetchgitLocal = import ../build-support/fetchgitlocal {
|
fetchgitLocal = import ../build-support/fetchgitlocal {
|
||||||
inherit runCommand git;
|
inherit runCommand git nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchmtn = callPackage ../build-support/fetchmtn (config.fetchmtn or {});
|
fetchmtn = callPackage ../build-support/fetchmtn (config.fetchmtn or {});
|
||||||
|
|
Loading…
Reference in a new issue