@@ -1191,35 +1191,31 @@ echo @foo@
11911191 <replaceable>file</replaceable>.</para></listitem>
11921192 </varlistentry>
11931193
1194− <varlistentry xml:id='fun-baseHash'>
1195− <term>
1196− <function>baseHash</function>
1197− <replaceable>path</replaceable>
1198− <replaceable>suffix</replaceable>
1199− </term>
1194+
1195+ <varlistentry xml:id='fun-stripHash'>
1196+ <term><function>stripHash</function>
1197+ <replaceable>path</replaceable></term>
12001198 <listitem><para>Strips the directory and hash part of a store
12011199 path, storing the name part in the environment variable
1202− <literal>strippedName</literal>. If <literal>suffix</literal> is also
1203− provided, the suffix will also be removed. For example:</para>
1200+ <literal>strippedName</literal>. For example:
12041201
12051202<programlisting>
1206−baseHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
1203+stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
12071204# prints coreutils-8.24
1205+echo $strippedName
12081206</programlisting>
12091207
1208+ If you wish to store the result in another variable, then the
1209+ following idiom may be useful:
1210+
12101211<programlisting>
1211−baseHash "/nix/store/0016702zbydafsr20n9l1dcw7x2bf6jj-arraysugar-0.1.0.gem" .gem
1212−# prints arraysugar-0.1.0
1212+name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
1213+someVar=$(stripHash $name; echo $strippedName)
12131214</programlisting>
1214− </listitem>
12151215
1216+ </para></listitem>
12161217 </varlistentry>
12171218
1218− <varlistentry xml:id='fun-stripHash'>
1219− <term><function>stripHash</function>
1220− <replaceable>path</replaceable></term>
1221− <listitem><para>Deprecated. Use baseHash instead.</para></listitem>
1222− </varlistentry>
12231219
12241220</variablelist>
12251221