lol

stdenv stripHash(): fixup after #19324

+5 -5
+5 -5
pkgs/stdenv/generic/setup.sh
··· 490 490 } 491 491 492 492 493 - # Utility function: return the base name of the given path, with the 493 + # Utility function: echo the base name of the given path, with the 494 494 # prefix `HASH-' removed, if present. 495 495 stripHash() { 496 - strippedName=$(basename $1); 496 + local strippedName="$(basename "$1")"; 497 497 if echo "$strippedName" | grep -q '^[a-z0-9]\{32\}-'; then 498 498 echo "$strippedName" | cut -c34- 499 + else 500 + echo "$strippedName" 499 501 fi 500 502 } 501 503 ··· 506 508 507 509 if [ -d "$fn" ]; then 508 510 509 - stripHash "$fn" 510 - 511 511 # We can't preserve hardlinks because they may have been 512 512 # introduced by store optimization, which might break things 513 513 # in the build. 514 - cp -pr --reflink=auto "$fn" $strippedName 514 + cp -pr --reflink=auto "$fn" "$(stripHash "$fn")" 515 515 516 516 else 517 517