From 8e3aff0ce03cbc44b2fa80fb62fa2378a5212a5a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 10 May 2010 11:00:11 +0200 Subject: more randomconfig testsuite fixes Signed-off-by: Denys Vlasenko --- scripts/gen_build_files.sh | 80 +++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh index 3d75750..2baefa2 100755 --- a/scripts/gen_build_files.sh +++ b/scripts/gen_build_files.sh @@ -3,52 +3,52 @@ test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; } # cd to objtree -cd "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; } +cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; } srctree="$1" find -type d | while read; do - d="$REPLY" - - src="$srctree/$d/Kbuild.src" - dst="$d/Kbuild" - if test -f "$src"; then - echo " CHK $dst" - - s=`sed -n 's@^//kbuild:@@p' "$srctree/$d"/*.c` - echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp" - while read; do - test x"$REPLY" = x"INSERT" && REPLY="$s" - printf "%s\n" "$REPLY" - done <"$src" >>"$dst.$$.tmp" - - if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then - rm "$dst.$$.tmp" - else - echo " GEN $dst" - mv "$dst.$$.tmp" "$dst" + d="$REPLY" + + src="$srctree/$d/Kbuild.src" + dst="$d/Kbuild" + if test -f "$src"; then + echo " CHK $dst" + + s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c` + echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp" + while read; do + test x"$REPLY" = x"INSERT" && REPLY="$s" + printf "%s\n" "$REPLY" + done <"$src" >>"$dst.$$.tmp" + + if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then + rm -- "$dst.$$.tmp" + else + echo " GEN $dst" + mv -- "$dst.$$.tmp" "$dst" + fi fi - fi - - src="$srctree/$d/Config.src" - dst="$d/Config.in" - if test -f "$src"; then - echo " CHK $dst" - - s=`sed -n 's@^//config:@@p' "$srctree/$d"/*.c` - echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp" - while read; do - test x"$REPLY" = x"INSERT" && REPLY="$s" - printf "%s\n" "$REPLY" - done <"$src" >>"$dst.$$.tmp" - - if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then - rm "$dst.$$.tmp" - else - echo " GEN $dst" - mv "$dst.$$.tmp" "$dst" + + src="$srctree/$d/Config.src" + dst="$d/Config.in" + if test -f "$src"; then + echo " CHK $dst" + + s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c` + echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp" + while read; do + test x"$REPLY" = x"INSERT" && REPLY="$s" + printf "%s\n" "$REPLY" + done <"$src" >>"$dst.$$.tmp" + + if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then + rm -- "$dst.$$.tmp" + else + echo " GEN $dst" + mv -- "$dst.$$.tmp" "$dst" + fi fi - fi done -- cgit v1.1