stdenv: introduce baseHash() to replace stripHash()

stripHash uses a global variable to communicate it's computation
results, but it's not necessary. You can just pipe to stdout in a
subshell. A function mostly behaves like just another command.

baseHash() also introduces a suffix-stripping capability since it's
something the users of the function tend to use.
This commit is contained in:
zimbatm
2016-06-25 14:20:56 +01:00
parent 7060eaf0bb
commit e71a5cb878
12 changed files with 45 additions and 36 deletions
@@ -3,5 +3,4 @@ source $stdenv/setup
mkdir -p $out/xml/dtd/docbook-ebnf
cd $out/xml/dtd/docbook-ebnf
cp -p $dtd dbebnf.dtd
stripHash $catalog
cp -p $catalog $strippedName
cp -p $catalog $(baseHash $catalog)