summary refs log tree commit diff
path: root/doc/stdenv.xml
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2016-10-11 18:09:56 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2016-10-11 18:34:36 +0200
commitbef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4 (patch)
tree6f7439b3f02e47ed1960a0b4d62ee4c01ef6d7af /doc/stdenv.xml
parent8417c3aae100c1a46e423804a2f6a85a82816685 (diff)
downloadnixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar.gz
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar.bz2
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar.lz
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar.xz
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.tar.zst
nixpkgs-bef6bef0d2ce2ef7cfaa3e9f1eac2cdc793560c4.zip
stdenv/stripHash: print to stdout, not to variable
`stripHash` documentation states that it prints out the stripped name to
the stdout, but the function stored the value in `strippedName`
instead.

Basically all usages did something like
`$(stripHash $foo | echo $strippedName)` which is just braindamaged.
Fixed the implementation and all invocations.
Diffstat (limited to 'doc/stdenv.xml')
-rw-r--r--doc/stdenv.xml9
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 2e88d6b4154..68441ea9393 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1231,13 +1231,12 @@ echo @foo@
     <term><function>stripHash</function>
     <replaceable>path</replaceable></term>
     <listitem><para>Strips the directory and hash part of a store
-    path, storing the name part in the environment variable
-    <literal>strippedName</literal>. For example:
+    path, outputting the name part to <literal>stdout</literal>.
+    For example:
     
 <programlisting>
-stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
 # prints coreutils-8.24
-echo $strippedName
+stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
 </programlisting>
 
     If you wish to store the result in another variable, then the
@@ -1245,7 +1244,7 @@ echo $strippedName
     
 <programlisting>
 name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
-someVar=$(stripHash $name; echo $strippedName)
+someVar=$(stripHash $name)
 </programlisting>
 
     </para></listitem>