nixpkgs/nixos/modules/services/networking/ircd-hybrid/builder.sh
Profpatsch bef6bef0d2
stdenv/stripHash: print to stdout, not to variable
`stripHash` documentation states that it prints out the stripped name to
the stdout, but the function stored the value in `strippedName`
instead.

Basically all usages did something like
`$(stripHash $foo | echo $strippedName)` which is just braindamaged.
Fixed the implementation and all invocations.
2016-10-11 18:34:36 +02:00

32 lines
615 B
Bash

source $stdenv/setup
doSub() {
local src=$1
local dst=$2
mkdir -p $(dirname $dst)
substituteAll $src $dst
}
subDir=/
for i in $scripts; do
if test "$(echo $i | cut -c1-2)" = "=>"; then
subDir=$(echo $i | cut -c3-)
else
dst=$out/$subDir/$(stripHash $i | sed 's/\.in//')
doSub $i $dst
chmod +x $dst # !!!
fi
done
subDir=/
for i in $substFiles; do
if test "$(echo $i | cut -c1-2)" = "=>"; then
subDir=$(echo $i | cut -c3-)
else
dst=$out/$subDir/$(stripHash $i | sed 's/\.in//')
doSub $i $dst
fi
done
mkdir -p $out/bin