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
+1 -2
View File
@@ -531,8 +531,7 @@ rec {
# Hacky: RPM looks for <basename>.spec inside the tarball, so
# strip off the hash.
stripHash "$src"
srcName="$strippedName"
srcName=$(baseHash "$src")
cp "$src" "$srcName" # `ln' doesn't work always work: RPM requires that the file is owned by root
export HOME=/tmp/home