about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-10-14 09:24:21 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-10-14 09:24:21 +0200
commit027efec8798547c0e8cff7861680f9b95732c12d (patch)
treed7925d2d5946f88fad4800d3c13295cfccad026d /pkgs/stdenv
parente0210d7cbff0f2c0a1308bc3cb762e552234d0e1 (diff)
parent3eec7ea3f0306ee4246ea85d4170dd64d89eb6ba (diff)
downloadnixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar.gz
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar.bz2
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar.lz
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar.xz
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.tar.zst
nixlib-027efec8798547c0e8cff7861680f9b95732c12d.zip
Merge staging without python splitting for now
The split needs more time to finish rebuilding,
but the rest seems OK and there are security fixes.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/setup.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index feb82fd92266..154fdefd789c 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -490,12 +490,14 @@ dumpVars() {
 }
 
 
-# Utility function: return the base name of the given path, with the
+# Utility function: echo the base name of the given path, with the
 # prefix `HASH-' removed, if present.
 stripHash() {
-    strippedName=$(basename $1);
+    local strippedName="$(basename "$1")";
     if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then
-        strippedName=$(echo "$strippedName" | cut -c34-)
+        echo "$strippedName" | cut -c34-
+    else
+        echo "$strippedName"
     fi
 }
 
@@ -506,12 +508,10 @@ _defaultUnpack() {
 
     if [ -d "$fn" ]; then
 
-        stripHash "$fn"
-
         # We can't preserve hardlinks because they may have been
         # introduced by store optimization, which might break things
         # in the build.
-        cp -pr --reflink=auto "$fn" $strippedName
+        cp -pr --reflink=auto "$fn" "$(stripHash "$fn")"
 
     else