syntax-check: fix violations and implement sc_prohibit_space_semicolon.

No need for a spurious space before a command ending semi-colon.
* cfg.mk (sc_prohibit_space_semicolon): New test to catch
accidental reintroduction of spurious spaces removed by this
changeset.
* bootstrap, build-aux/general.m4sh, build-aux/ltmain.m4sh,
libltdl/lt__strl.c, m4/libtool.m4, m4/ltdl.m4, tests/bindir.at:
Remove spurious spaces.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
This commit is contained in:
Gary V. Vaughan 2012-10-04 20:04:32 +07:00
parent 0b1b671864
commit 9847559cef
8 changed files with 67 additions and 61 deletions

View File

@ -1263,9 +1263,9 @@ func_require_gnulib_merge_changelog ()
$require_git
func_grep_q '^\(/\|\)ChangeLog$' .gitignore || test true = "$GIT" || {
if $GIT config merge.merge-changelog.driver >/dev/null ; then
if $GIT config merge.merge-changelog.driver >/dev/null; then
:
elif (git-merge-changelog --version) >/dev/null 2>&1 ; then
elif (git-merge-changelog --version) >/dev/null 2>&1; then
func_echo "initializing git-merge-changelog driver"
$GIT config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
$GIT config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
@ -2141,7 +2141,7 @@ func_sort_ver ()
# Split on '.' and compare each component.
i=1
while : ; do
while :; do
p1=`echo "$ver1" |cut -d. -f$i`
p2=`echo "$ver2" |cut -d. -f$i`
if test ! "$p1"; then

View File

@ -313,7 +313,7 @@ func_normal_abspath ()
# Processed it all yet?
if test / = "$func_normal_abspath_tpath"; then
# If we ascended to the root using ".." the result may be empty now.
if test -z "$func_normal_abspath_result" ; then
if test -z "$func_normal_abspath_result"; then
func_normal_abspath_result=/
fi
break

View File

@ -726,7 +726,7 @@ func_convert_core_path_wine_to_w32 ()
for func_convert_core_path_wine_to_w32_f in $1; do
IFS=$oldIFS
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
if test -n "$func_convert_core_file_wine_to_w32_result" ; then
if test -n "$func_convert_core_file_wine_to_w32_result"; then
if test -z "$func_convert_core_path_wine_to_w32_result"; then
func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
else
@ -795,7 +795,7 @@ func_convert_file_check ()
{
$debug_cmd
if test -z "$2" && test -n "$1" ; then
if test -z "$2" && test -n "$1"; then
func_error "Could not determine host file name corresponding to"
func_error " \`$1'"
func_error "Continuing, but uninstalled executables may not work."
@ -2586,7 +2586,7 @@ extern \"C\" {
if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
# Use subshell, to avoid clobbering current variable values
dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
if test -n "$dlprefile_dlname" ; then
if test -n "$dlprefile_dlname"; then
func_basename "$dlprefile_dlname"
dlprefile_dlbasename=$func_basename_result
else
@ -2596,7 +2596,7 @@ extern \"C\" {
fi
fi
$opt_dry_run || {
if test -n "$dlprefile_dlbasename" ; then
if test -n "$dlprefile_dlbasename"; then
eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
else
func_warning "Could not compute DLL name from $name"
@ -2928,10 +2928,10 @@ func_cygming_dll_for_implib_fallback ()
{
$debug_cmd
if func_cygming_gnu_implib_p "$1" ; then
if func_cygming_gnu_implib_p "$1"; then
# binutils import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
elif func_cygming_ms_implib_p "$1" ; then
elif func_cygming_ms_implib_p "$1"; then
# ms-generated import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
else
@ -3019,7 +3019,7 @@ func_extract_archives ()
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches ; do
for darwin_arch in $darwin_arches; do
func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
$LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
cd "unfat-$$/$darwin_base_archive-$darwin_arch"
@ -4603,7 +4603,7 @@ func_mode_link ()
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
if test -z "$pic_object" || test none = "$pic_object" ; then
if test -z "$pic_object" || test none = "$pic_object"; then
arg=$non_pic_object
fi
else
@ -5285,7 +5285,7 @@ func_mode_link ()
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if $opt_preserve_dup_deps ; then
if $opt_preserve_dup_deps; then
case "$libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@ -5456,7 +5456,7 @@ func_mode_link ()
for l in $old_library $library_names; do
ll=$l
done
if test "X$ll" = "X$old_library" ; then # only static version available
if test "X$ll" = "X$old_library"; then # only static version available
found=false
func_dirname "$lib" "" "."
ladir=$func_dirname_result
@ -5689,7 +5689,7 @@ func_mode_link ()
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
if $opt_preserve_dup_deps ; then
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@ -5864,7 +5864,7 @@ func_mode_link ()
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if $opt_preserve_dup_deps ; then
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@ -5880,7 +5880,7 @@ func_mode_link ()
test built,yes = "$prefer_static_libs,$installed"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
# Make sure the rpath contains only unique directories.
case $temp_rpath: in
*"$absdir:"*) ;;
@ -6051,10 +6051,10 @@ func_mode_link ()
# if the lib is a (non-dlopened) module then we cannot
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2> /dev/null |
$GREP ": [^:]* bundle" >/dev/null ; then
$GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then
if test -z "$old_library"; then
echo
echo "*** And there doesn't seem to be a static archive available"
echo "*** The link will probably fail, sorry"
@ -6150,7 +6150,7 @@ func_mode_link ()
add=-l$name
elif test yes = "$hardcode_automatic"; then
if test -n "$inst_prefix_dir" &&
test -f "$inst_prefix_dir$libdir/$linklib" ; then
test -f "$inst_prefix_dir$libdir/$linklib"; then
add=$inst_prefix_dir$libdir/$linklib
else
add=$libdir/$linklib
@ -6259,7 +6259,7 @@ func_mode_link ()
func_resolve_sysroot "$func_stripname_result";;
*) func_resolve_sysroot "$deplib" ;;
esac
if $opt_preserve_dup_deps ; then
if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $func_resolve_sysroot_result "*)
func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@ -6295,11 +6295,11 @@ func_mode_link ()
*-*-darwin*)
depdepl=
eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
if test -n "$deplibrary_names"; then
for tmp in $deplibrary_names; do
depdepl=$tmp
done
if test -f "$absdir/$objdir/$depdepl" ; then
if test -f "$absdir/$objdir/$depdepl"; then
depdepl=$absdir/$objdir/$depdepl
darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
if test -z "$darwin_install_name"; then
@ -6426,13 +6426,13 @@ func_mode_link ()
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
for i in $dependency_libs ; do
for i in $dependency_libs; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
i=
;;
esac
if test -n "$i" ; then
if test -n "$i"; then
func_append tmp_libs " $i"
fi
done
@ -6944,12 +6944,12 @@ EOF
;;
esac
fi
if test -n "$i" ; then
if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
func_append newdeplibs " $i"
else
droppeddeps=yes
@ -6987,12 +6987,12 @@ EOF
;;
esac
fi
if test -n "$i" ; then
if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
func_append newdeplibs " $i"
else
droppeddeps=yes
@ -7037,7 +7037,7 @@ EOF
;;
esac
fi
if test -n "$a_deplib" ; then
if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
if test -n "$file_magic_glob"; then
libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
@ -7082,7 +7082,7 @@ EOF
done
done
fi
if test -n "$a_deplib" ; then
if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@ -7090,7 +7090,7 @@ EOF
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for file magic test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
@ -7121,7 +7121,7 @@ EOF
;;
esac
fi
if test -n "$a_deplib" ; then
if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
@ -7136,7 +7136,7 @@ EOF
done
done
fi
if test -n "$a_deplib" ; then
if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@ -7144,7 +7144,7 @@ EOF
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
@ -7163,7 +7163,7 @@ EOF
newdeplibs=
tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
if test yes = "$allow_libtool_libs_with_static_runtimes"; then
for i in $predeps $postdeps ; do
for i in $predeps $postdeps; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
done
@ -7529,7 +7529,7 @@ EOF
fi
# Do each of the archive commands.
if test yes = "$module" && test -n "$module_cmds" ; then
if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
@ -7747,7 +7747,7 @@ EOF
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
if test yes = "$module" && test -n "$module_cmds" ; then
if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
@ -8306,7 +8306,7 @@ EOF
trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
if test "x$build" = "x$host" ; then
if test "x$build" = "x$host"; then
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
@ -8462,7 +8462,7 @@ EOF
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj" ; then
if test "$obj" = "$last_oldobj"; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
@ -8834,7 +8834,7 @@ func_mode_uninstall ()
if test yes = "$fast_install" && test -n "$relink_command"; then
func_append rmfiles " $odir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
if test "X$noexename" != "X$name"; then
func_append rmfiles " $odir/lt-$noexename.c"
fi
fi

6
cfg.mk
View File

@ -146,6 +146,12 @@ sc_prohibit_set_minus_minus:
halt="use \`set dummy ...' instead of \`set -- ...'" \
$(_sc_search_regexp)
# Make sure there is no spurious whitespace before trailing semi-colons
sc_prohibit_space_semicolon:
@prohibit='[^ ][ ]+;[ ]*((do|done|elif|else|then)[ ]*)?$$' \
halt='found spurious whitespace before trailing semi-colon' \
$(_sc_search_regexp)
# Check for using test X"... instead of test "X...
exclude_file_name_regexp--sc_prohibit_test_X = ^cfg.mk$$
sc_prohibit_test_X:

View File

@ -65,7 +65,7 @@ lt_strlcat(char *dst, const char *src, const size_t dstsize)
size - 1.
*/
for ( p = dst + length, q = src;
(*q != 0) && (length < dstsize - 1) ;
(*q != 0) && (length < dstsize - 1);
length++, p++, q++ )
*p = *q;
@ -109,8 +109,8 @@ lt_strlcpy(char *dst, const char *src, const size_t dstsize)
/*
Copy src to dst within bounds of size-1.
*/
for ( p=dst, q=src, length=0 ;
(*q != 0) && (length < dstsize-1) ;
for ( p=dst, q=src, length=0;
(*q != 0) && (length < dstsize-1);
length++, p++, q++ )
*p = *q;

18
m4/libtool.m4 vendored
View File

@ -179,11 +179,11 @@ m4_require([_LT_WITH_SYSROOT])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
if test -n "\${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
])
if test -n "${ZSH_VERSION+set}" ; then
if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@ -705,7 +705,7 @@ _LT_CONFIG_SAVE_COMMANDS([
m4_if(_LT_TAG, [C], [
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@ -1027,7 +1027,7 @@ _LT_EOF
_lt_result=$?
if test -s conftest.err && $GREP force_load conftest.err; then
cat conftest.err >&AS_MESSAGE_LOG_FD
elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1 ; then
elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@ -1697,7 +1697,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
for i in 1 2 3 4 5 6 7 8 ; do
for i in 1 2 3 4 5 6 7 8; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
@ -1722,7 +1722,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
;;
esac
])
if test -n "$lt_cv_sys_max_cmd_len" ; then
if test -n "$lt_cv_sys_max_cmd_len"; then
AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
else
AC_MSG_RESULT(none)
@ -2801,7 +2801,7 @@ sysv4 | sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec ;then
if test -d /usr/nec; then
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
soname_spec='$libname$shared_ext.$major'
@ -3390,7 +3390,7 @@ else
IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
tmp_nm=$ac_dir/$lt_tmp_nm
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
@ -4453,7 +4453,7 @@ m4_if([$1], [CXX], [
;;
sysv4*MP*)
if test -d /usr/nec ;then
if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi

View File

@ -653,7 +653,7 @@ LIBADD_DLOPEN=
AC_SEARCH_LIBS([dlopen], [dl],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
if test "$ac_cv_search_dlopen" != "none required" ; then
if test "$ac_cv_search_dlopen" != "none required"; then
LIBADD_DLOPEN=-ldl
fi
libltdl_cv_lib_dl_dlopen=yes
@ -791,7 +791,7 @@ AC_DEFUN([LT_FUNC_DLSYM_USCORE],
[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
if test yes = "$lt_cv_sys_symbol_underscore"; then
if test yes = "$libltdl_cv_func_dlopen" ||
test yes = "$libltdl_cv_lib_dl_dlopen" ; then
test yes = "$libltdl_cv_lib_dl_dlopen"; then
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
[libltdl_cv_need_uscore],
[libltdl_cv_need_uscore=unknown

View File

@ -81,7 +81,7 @@ esac
func_save_and_prepend_path ()
{
save_PATH=$PATH
if $bindirneeded ; then
if $bindirneeded; then
PATH=$1:$PATH
fi
export PATH
@ -193,7 +193,7 @@ AT_CHECK([test yes = "$build_libtool_libs" || exit 77])
func_save_and_prepend_path ()
{
save_PATH=$PATH
if $bindirneeded ; then
if $bindirneeded; then
PATH=$1:$PATH
fi
export PATH
@ -257,7 +257,7 @@ for libdir in \
$curdir/usr/lib/ \
$curdir/usr/lib \
$curdir/baz \
$curdir/baz/lib/ ;
$curdir/baz/lib/;
do
# Do a basic install with no -bindir option for reference. We use the sbin/
@ -295,7 +295,7 @@ do
$curdir/usr/lib/bin \
$curdir/usr/bin/ \
$curdir/usr/bin \
/tmp/foo/bar ;
/tmp/foo/bar;
do
# Clear any old stuff out before we install. Because bindir
@ -355,7 +355,7 @@ do
# Clean up if we made a temp dir. Subdirs under our testdir get rm'd
# and recreated at the top of the loop. Securely created subdirs under
# /tmp get created precisely once and rm'd when we're done with them.
if test ! -z "$tmp" ; then
if test ! -z "$tmp"; then
rm -rf "$tmp"
fi