summaryrefslogtreecommitdiffstats
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2019-01-31 17:26:49 +0000
committerGitHub <noreply@github.com>2019-01-31 17:26:49 +0000
commit97870258b298830a46c7bc9719733a7aae760361 (patch)
treeeacd13312d827327842bef9e664e550866568b6b /pkgs/build-support
parent73d5530661783d79f8264e7802d7a4c108053479 (diff)
linkFarm: hacky quoting -> escapeShellArg
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/trivial-builders.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 7543433640a3..bb25cb20915a 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -258,15 +258,17 @@ rec {
* Example:
*
* # Symlinks hello path in store to current $out/hello
- * linkFarm "hello" entries = [ { name = "hello"; path = pkgs.hello; } ];
+ * linkFarm "hello" [ { name = "hello"; path = pkgs.hello; } ];
*
*/
linkFarm = name: entries: runCommand name { preferLocalBuild = true; }
- ("mkdir -p $out; cd $out; \n" +
- (lib.concatMapStrings (x: ''
- mkdir -p "$(dirname '${x.name}')"
- ln -s '${x.path}' '${x.name}'
- '') entries));
+ ''mkdir -p $out
+ cd $out
+ ${lib.concatMapStrings (x: ''
+ mkdir -p "$(dirname ${lib.escapeShellArg x.name})"
+ ln -s ${lib.escapeShellArg x.path} ${lib.escapeShellArg x.name}
+ '') entries}
+ '';
/* Print an error message if the file with the specified name and