From e15fc83fc94adcf28b9816ecf6b907e46b9de57b Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 11 Jan 2014 07:54:35 -0600 Subject: [PATCH] Don't split paths with spaces setup.sh uses the anti-pattern `for f in $(find ...); do` in several places. `find` returns one path per line, but `for` splits its arguments by words, so paths which contain spaces are incorrectly split! The correct way is `find ... | while read f; do` --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 12c5801d5eb9..3dee8dc020bc 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -575,7 +575,7 @@ configurePhase() { fi if [ -z "$dontFixLibtool" ]; then - for i in $(find . -name "ltmain.sh"); do + find . -iname "ltmain.sh" | while read i; do echo "fixing libtool script $i" fixLibtool $i done @@ -670,7 +670,7 @@ patchShebangs() { local oldInterpreterLine local newInterpreterLine - for f in $(find "$dir" -type f -perm +0100); do + find "$dir" -type f -perm +0100 | while read f; do if [ "$(head -1 "$f" | head -c +2)" != '#!' ]; then # missing shebang => not a script continue