summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-27 14:10:36 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-29 13:05:28 +0200
commit030e20f759d5a4e4962eabd4069fd06ae059e6f3 (patch)
tree816479523728a48f8ac7a849e06f052b3300e482 /pkgs
parent75a1ec8a655e7e00a6bb6fc944663c21624fff60 (diff)
downloadnixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar.gz
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar.bz2
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar.lz
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar.xz
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.tar.zst
nixlib-030e20f759d5a4e4962eabd4069fd06ae059e6f3.zip
Add a warning about using requireFile
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/trivial-builders.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 8775286b1172..692ac685d62d 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -97,12 +97,16 @@ rec {
       done < graph
     '';
 
+
   # Quickly create a set of symlinks to derivations.
   # entries is a list of attribute sets like { name = "name" ; path = "/nix/store/..."; }
   linkFarm = name: entries: runCommand name {} ("mkdir -p $out; cd $out; \n" +
     (lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries));
 
-  # Require file
+
+  # Print an error message if the file with the specified name and
+  # hash doesn't exist in the Nix store. Do not use this function; it
+  # produces packages that cannot be built automatically.
   requireFile = { name ? null
                 , sha256 ? null
                 , sha1 ? null
@@ -115,8 +119,8 @@ rec {
     let msg =
       if message != null then message
       else ''
-        Unfortunately, we may not download file ${name_} automatically.
-        Please, go to ${url} to download it yourself, and add it to the Nix store
+        Unfortunately, we cannot download file ${name_} automatically.
+        Please go to ${url} to download it yourself, and add it to the Nix store
         using either
           nix-store --add-fixed ${hashAlgo} ${name_}
         or
@@ -143,6 +147,7 @@ rec {
       '';
     };
 
+
   # Search in the environment if the same program exists with a set uid or
   # set gid bit.  If it exists, run the first program found, otherwise run
   # the default binary.
@@ -168,12 +173,14 @@ rec {
         exec ${bin} "$@"
       '';
 
+
   # Copy a path to the Nix store.
   # Nix automatically copies files to the store before stringifying paths.
   # If you need the store path of a file, ${copyPathToStore <path>} can be
   # shortened to ${<path>}.
   copyPathToStore = builtins.filterSource (p: t: true);
 
+
   # Copy a list of paths to the Nix store.
   copyPathsToStore = builtins.map copyPathToStore;