From: Gary V. Vaughan Date: Sun, 29 Jul 2001 16:35:50 +0000 (+0000) Subject: * tests/sh.test: Add a new test to enforce X as the fill X-Git-Tag: release-1-4d~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45ca0c82738f7f6d03bbe2c26db32bd30670c842;p=thirdparty%2Flibtool.git * tests/sh.test: Add a new test to enforce X as the fill character in `test "X...'. Beef up the `test' tests to also check `test -.' and `test ! -.' phrases for compliance. * ltmain.in: Fix quoting problems uncovered by the new tests. --- diff --git a/ChangeLog b/ChangeLog index 844f1a568..1ac14ee3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-07-29 Gary V. Vaughan + + * tests/sh.test: Add a new test to enforce X as the fill + character in `test "X...'. + Beef up the `test' tests to also check `test -.' and `test ! -.' + phrases for compliance. + * ltmain.in: Fix quoting problems uncovered by the new tests. + 2001-07-29 Andrew C. Feren * tests/sh.test: New test to disallow `test $foo', where diff --git a/ltmain.in b/ltmain.in index 784c06ee4..1bb891c69 100644 --- a/ltmain.in +++ b/ltmain.in @@ -681,7 +681,7 @@ compiler." fi # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else @@ -751,7 +751,7 @@ compiler." fi # Just move the object if needed - if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else diff --git a/tests/sh.test b/tests/sh.test index 66b5e9c33..8d3997538 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -32,20 +32,25 @@ if egrep -n -e 'if[ ]+\[' $scripts; then status=1 fi +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?"?[.,_x]' $scripts; then + echo "use \`test \"X...\"' instead of \`test \"x...\"'" + status=1 +fi + # Check for using test X... instead of test "X... -if egrep -n -e 'test[ ]+X' $scripts; then +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X' $scripts; then echo "use \`test \"X...\"' instead of \`test X'" status=1 fi # Check for using test $... instead of test "$... -if egrep -n -e 'test[ ]+(-.[ ]+)?X?\$' $scripts; then +if egrep -n -e 'test[ ]+(![ ])?(-.[ ]+)?X?\$' $scripts; then echo "use \`test \"\$...\"' instead of \`test \$'" status=1 fi # Never use test -e. -if egrep -n -e 'test[ ]+-e' $scripts; then +if egrep -n -e 'test[ ]+(![ ])?-e' $scripts; then echo "use \`test -f' instead of \`test -e'" status=1 fi