nixos/stage-1: use `readlink -e` in builder
The builder has this convoluted `while` loop which just replicates `readlink -e`. I'm sure there was a reason at one point, because the loop has been there since time immemorial. It kept getting copied around, I suspect because nobody bothered to understand what it actually did. Incidentally, this fixes #17513, but I have no idea why.
This commit is contained in:
parent
ee36bb8588
commit
68922e3f74
|
@ -87,15 +87,11 @@ let
|
||||||
LDD="$(ldd $BIN)" || continue
|
LDD="$(ldd $BIN)" || continue
|
||||||
LIBS="$(echo "$LDD" | awk '{print $3}' | sed '/^$/d')"
|
LIBS="$(echo "$LDD" | awk '{print $3}' | sed '/^$/d')"
|
||||||
for LIB in $LIBS; do
|
for LIB in $LIBS; do
|
||||||
[ ! -f "$out/lib/$(basename $LIB)" ] && cp -pdv $LIB $out/lib
|
TGT="$out/lib/$(basename $LIB)"
|
||||||
while [ "$(readlink $LIB)" != "" ]; do
|
if [ ! -f "$TGT" ]; then
|
||||||
LINK="$(readlink $LIB)"
|
SRC="$(readlink -e $LIB)"
|
||||||
if [ "''${LINK:0:1}" != "/" ]; then
|
cp -pdv "$SRC" "$TGT"
|
||||||
LINK="$(dirname $LIB)/$LINK"
|
fi
|
||||||
fi
|
|
||||||
LIB="$LINK"
|
|
||||||
[ ! -f "$out/lib/$(basename $LIB)" ] && cp -pdv $LIB $out/lib
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue