summary refs log tree commit diff
path: root/pkgs/build-support/vm
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-06-23 11:53:45 +0100
committerzimbatm <zimbatm@zimbatm.com>2016-06-25 14:20:56 +0100
commite71a5cb87841f0af4a2279517b77a9a07ba394c0 (patch)
treec233b5bc126f79effc16d5b9ac60bfa3f1c1ea64 /pkgs/build-support/vm
parent7060eaf0bb98f3b4b6d10e7e55d20df9527866bf (diff)
downloadnixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar.gz
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar.bz2
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar.lz
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar.xz
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.tar.zst
nixlib-e71a5cb87841f0af4a2279517b77a9a07ba394c0.zip
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.
Diffstat (limited to 'pkgs/build-support/vm')
-rw-r--r--pkgs/build-support/vm/default.nix3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 82cb72cb67ea..3753668bcbfb 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -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