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.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user