From e71a5cb87841f0af4a2279517b77a9a07ba394c0 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 23 Jun 2016 11:53:45 +0100 Subject: 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. --- pkgs/build-support/vm/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkgs/build-support/vm') 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 .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 -- cgit 1.4.1