on iko/ghcjs-patch-master help sign in
git-ls-files should prefer local building (#1378)
c084516Cheng Shao
lib/clean-git.nix+4−4
@@ -1,5 +1,5 @@
1# From https://github.com/NixOS/nix/issues/2944
1# From https://github.com/NixOS/nix/issues/2944
2−{ lib, runCommand, git, cleanSourceWith }:
2+{ lib, runCommandLocal, git, cleanSourceWith }:
3{ name ? null, src, subDir ? "", includeSiblings ? false, keepGitDir ? false }:
3{ name ? null, src, subDir ? "", includeSiblings ? false, keepGitDir ? false }:
4
4
5# The function call
5# The function call
@@ -112,7 +112,7 @@ then
112 # `git ls-files --recurse-submodules` to give us an accurate list
112 # `git ls-files --recurse-submodules` to give us an accurate list
113 # of all the files in the index.
113 # of all the files in the index.
114 whitelist_files = knownSubmoduleDirs:
114 whitelist_files = knownSubmoduleDirs:
115− runCommand "git-ls-files" {} ''
115+ runCommandLocal "git-ls-files" {} ''
116 tmp=$(mktemp -d)
116 tmp=$(mktemp -d)
117 cd $tmp
117 cd $tmp
118 ${ lib.optionalString hasSubmodules ''
118 ${ lib.optionalString hasSubmodules ''
@@ -135,7 +135,7 @@ then
135 ${git}/bin/git ls-files --recurse-submodules > $out/files
135 ${git}/bin/git ls-files --recurse-submodules > $out/files
136 '';
136 '';
137
137
138− # Find the submodules
138+ # Find the submodules
139 whitelist_recursive = knownSubmoduleDirs:
139 whitelist_recursive = knownSubmoduleDirs:
140 let
140 let
141 # Get the new list of submoduleDirs and files
141 # Get the new list of submoduleDirs and files
@@ -176,7 +176,7 @@ then
176 );
176 );
177
177
178 # Identify files in the `.git` dir
178 # Identify files in the `.git` dir
179− isGitDirPath = path:
179+ isGitDirPath = path:
180 path == origSrcSubDir + "/.git"
180 path == origSrcSubDir + "/.git"
181 || lib.hasPrefix (origSrcSubDir + "/.git/") path;
181 || lib.hasPrefix (origSrcSubDir + "/.git/") path;
182
182