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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user