about summary refs log tree commit diff
path: root/pkgs/build-support/trivial-builders.nix
diff options
context:
space:
mode:
authorPasquale <p3dimaria@hotmail.it>2021-11-28 19:33:22 +0100
committerPasquale <p3dimaria@hotmail.it>2021-11-28 19:35:43 +0100
commit67320a16689b84361777f3a03c8dcc5b72a339dc (patch)
tree5bda6281f8cd56b9705f86bea3a54eda628ffb8a /pkgs/build-support/trivial-builders.nix
parentf81734f4e69b0e74bcfc4e84a134387a5763d43c (diff)
concatText: fix typos
Diffstat (limited to 'pkgs/build-support/trivial-builders.nix')
-rw-r--r--pkgs/build-support/trivial-builders.nix18
1 files changed, 7 insertions, 11 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index ee5a492cdc182..b02afb37943a4 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -332,14 +332,12 @@ rec {
    *   name = "my-file";
    *   files = [ drv1 "${drv2}/path/to/file" ];
    * }
-   * # See also the `concatdText` helper function below.
+   * # See also the `concatText` helper function below.
    *
    * # Writes executable my-file to /nix/store/<store path>/bin/my-file
    * concatTextFile {
    *   name = "my-file";
-   *   files = ''
-   *     Contents of File
-   *   '';
+   *   files = [ drv1 "${drv2}/path/to/file" ];
    *   executable = true;
    *   destination = "/bin/my-file";
    * }
@@ -355,14 +353,12 @@ rec {
     runCommandLocal name
       { inherit files executable checkPhase meta destination; }
       ''
-        n=$out$destination
-        mkdir -p "$(dirname "$n")"
-        cat $files > "$n"
-        touch "$n"
+        file=$out$destination
+        mkdir -p "$(dirname "$file")"
+        cat $files > "$file"
 
+        (test -n "$executable" && chmod +x "$file") || true
         eval "$checkPhase"
-
-        (test -n "$executable" && chmod +x "$n") || true
       '';
 
 
@@ -381,7 +377,7 @@ rec {
    *
    * Example:
    * # Writes contents of files to /nix/store/<store path>
-   * concatdScript "my-file" [ file1 file2 ]
+   * concatScript "my-file" [ file1 file2 ]
    *
   */
   concatScript = name: files: concatTextFile { inherit name files; executable=true; };