newlib-nano: Fix build

The original check, while terse, causes the shell to exit after the
`for` loop if any file is non-existent.
This commit is contained in:
Zhaofeng Li
2025-01-22 14:08:24 -07:00
parent 5df43628fd
commit cf69ff8265
+5 -1
View File
@@ -118,7 +118,11 @@ stdenv.mkDerivation (finalAttrs: {
for f in librdimon.a libc.a libm.a libg.a libgloss.a; do
# Some libraries are only available for specific architectures.
# For example, librdimon.a is only available on ARM.
[ -f "$f" ] && cp "$f" "''${f%%\.a}_nano.a"
if [ -f "$f" ]; then
dst="''${f%%\.a}_nano.a"
>&2 echo "$f -> $dst"
cp "$f" "$dst"
fi
done
)
''