]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* tests/sh.test: After `set dummy [...]', check for `shift'
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 10 Jan 2005 11:00:05 +0000 (11:00 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 10 Jan 2005 11:00:05 +0000 (11:00 +0000)
within the same and following line.
* config/ltmain.m4sh (func_enable_tag, func_mode_install)
(func_mode_link): Sprinkle `shift's all over to conform to this.

ChangeLog
config/ltmain.m4sh
tests/sh.test

index 2b0ea52a5be974b3bd5adb42aa149eca0b4b171e..fdd0c0063e351728320abc1c1c15f5e95f3ff29b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * tests/sh.test: After `set dummy [...]', check for `shift'
+       within the same and following line.
+       * config/ltmain.m4sh (func_enable_tag, func_mode_install)
+       (func_mode_link): Sprinkle `shift's all over to conform to this.
+
 2005-01-09  Gary V. Vaughan  <gary@gnu.org>
 
        * HACKING (Editing 'ChangeLog'): Follow the GCS with respect to
index 3eff24d925f2e4d1e65fed0bf22af48c8ed52eef..7a3761dd77ce2aab15622b4f6db520657f42f27f 100644 (file)
@@ -1747,8 +1747,8 @@ func_mode_install ()
       destname=`$ECHO "X$dest" | $Xsed -e 's%^.*/%%'`
 
       # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      test "$#" -gt 2 && \
+      set dummy $files; shift
+      test "$#" -gt 1 && \
        func_fatal_help "\`$dest' is not a directory"
     fi
     case $destdir in
@@ -1840,10 +1840,9 @@ func_mode_install ()
        fi
 
        # See the names of the shared library.
-       set dummy $library_names
-       if test -n "$2"; then
-         realname="$2"
-         shift
+       set dummy $library_names; shift
+       if test -n "$1"; then
+         realname="$1"
          shift
 
          srcname="$realname"
@@ -3272,8 +3271,8 @@ func_mode_link ()
              valid_a_lib=no
              case $deplibs_check_method in
                match_pattern*)
-                 set dummy $deplibs_check_method
-                 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+                 set dummy $deplibs_check_method; shift
+                 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
                  if eval $ECHO \"X$deplib\" 2>/dev/null | $Xsed -e 10q \
                    | $EGREP "$match_pattern_regex" > /dev/null; then
                    valid_a_lib=yes
@@ -3654,8 +3653,9 @@ func_mode_link ()
          if test -n "$old_archive_from_expsyms_cmds"; then
            # figure out the soname
            set dummy $library_names
-           realname="$2"
-           shift; shift
+           shift
+           realname="$1"
+           shift
            libname=`eval \\$ECHO \"$libname_spec\"`
            # use dlname if we got it. it's perfectly good, no?
            if test -n "$dlname"; then
@@ -4169,10 +4169,11 @@ func_mode_link ()
        func_warning "\`-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
-      test "$#" -gt 2 && \
+      shift
+      test "$#" -gt 1 && \
        func_warning "ignoring multiple \`-rpath's for a libtool library"
 
-      install_libdir="$2"
+      install_libdir="$1"
 
       oldlibs=
       if test -z "$rpath"; then
@@ -4196,9 +4197,10 @@ func_mode_link ()
        # Parse the version information argument.
        save_ifs="$IFS"; IFS=':'
        set dummy $vinfo 0 0 0
+       shift
        IFS="$save_ifs"
 
-       test -n "$8" && \
+       test -n "$7" && \
          func_fatal_help "too many parameters to \`-version-info'"
 
        # convert absolute version numbers to libtool ages
@@ -4207,9 +4209,9 @@ func_mode_link ()
 
        case $vinfo_number in
        yes)
-         number_major="$2"
-         number_minor="$3"
-         number_revision="$4"
+         number_major="$1"
+         number_minor="$2"
+         number_revision="$3"
          #
          # There are really only two kinds -- those that
          # use the current revision as the major version
@@ -4236,9 +4238,9 @@ func_mode_link ()
          esac
          ;;
        no)
-         current="$2"
-         revision="$3"
-         age="$4"
+         current="$1"
+         revision="$2"
+         age="$3"
          ;;
        esac
 
@@ -4563,8 +4565,8 @@ EOF
                if test -n "$i" ; then
                  libname=`eval \\$ECHO \"$libname_spec\"`
                  deplib_matches=`eval \\$ECHO \"$library_names_spec\"`
-                 set dummy $deplib_matches
-                 deplib_match=$2
+                 set dummy $deplib_matches; shift
+                 deplib_match=$1
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
                    newdeplibs="$newdeplibs $i"
                  else
@@ -4605,8 +4607,8 @@ EOF
                  if test -n "$i" ; then
                    libname=`eval \\$ECHO \"$libname_spec\"`
                    deplib_matches=`eval \\$ECHO \"$library_names_spec\"`
-                   set dummy $deplib_matches
-                   deplib_match=$2
+                   set dummy $deplib_matches; shift
+                   deplib_match=$1
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
                      newdeplibs="$newdeplibs $i"
                    else
@@ -4635,8 +4637,8 @@ EOF
          fi
          ;;
        file_magic*)
-         set dummy $deplibs_check_method
-         file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+         set dummy $deplibs_check_method; shift
+         file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
          for a_deplib in $deplibs; do
            name="`expr $a_deplib : '-l\(.*\)'`"
            # If $name is empty we are operating on a -L argument.
@@ -4704,8 +4706,8 @@ EOF
          done # Gone through all deplibs.
          ;;
        match_pattern*)
-         set dummy $deplibs_check_method
-         match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+         set dummy $deplibs_check_method; shift
+         match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
          for a_deplib in $deplibs; do
            name="`expr $a_deplib : '-l\(.*\)'`"
            # If $name is empty we are operating on a -L argument.
@@ -4914,8 +4916,9 @@ EOF
        eval shared_ext=\"$shrext_cmds\"
        eval library_names=\"$library_names_spec\"
        set dummy $library_names
-       realname="$2"
-       shift; shift
+       shift
+       realname="$1"
+       shift
 
        if test -n "$soname_spec"; then
          eval soname=\"$soname_spec\"
index 0b5be69f94b1c13288f40c636c80698deee9d031..5b6ebd66155a4fac2b3015f626da9ae04fcd6804 100755 (executable)
@@ -81,4 +81,14 @@ if $EGREP -n -e 'set[        ]+--[   ]+' $scripts; then
   status=$EXIT_FAILURE
 fi
 
+# Check for using shift after set dummy (same or following line).
+for s in $scripts
+do
+  if $SED -n '/set[    ][      ]*dummy/{/set.*dummy.*;.*shift/d;N;/set.*dummy.*\n.*shift/D;p;}' "$s" |
+     $EGREP .; then
+    echo "use \`shift' after \`set dummy' in $s"
+    status=$EXIT_FAILURE
+  fi
+done
+
 exit $status