autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AT_KEYWORDS failure: cmdline OR-combinations


From: Ralf Wildenhues
Subject: Re: AT_KEYWORDS failure: cmdline OR-combinations
Date: Tue, 16 Aug 2005 18:10:52 +0200
User-agent: Mutt/1.4.1i

Hi Stepan,

* Stepan Kasal wrote on Tue, Aug 16, 2005 at 04:28:04PM CEST:
> 
> I noticed a problem with your patch:

*snip excerpt*
> So --keyword might select several banners, but they are 0 for the purpose
> of sort -nu.  This means that one of the banners will be at the top, and all
> others are removed.

Yep.  I completely forgot about the banners.

*snip idea*
> Ralf, do you have time to incorporate this idea into your patch?

I will put it in a separate patch, so that this one is hopefully clean
to apply.  Multiple test invocations were broken in the same way before,
they are an orthogonal issue.

> There one problem, though: whenever I try to write a piece of awk code,
> it doesn't work with the @$%#$^* /bin/awk on Solaris.
> I don't have access to Solaris, but perhaps you could debug my awk
> program so that it works there.

Yes.  Solaris and AIX I can do.  Could you (or someone else) meanwhile
check that Mac OS 10.4 `expr' copes with the expressions fixed in this
patch?  I happen not to understand the exact nature of the bug report
that led to the breakage of this code in the first place:
http://lists.gnu.org/archive/html/autoconf-patches/2005-06/msg00041.html

Solaris awk needs a workaround similar to the other awk invocation in
Autotest.

Cheers,
Ralf

        * lib/autotest/general.m4 (AT_INIT): Add a couple of missing
        m4 quotes.  Process multiple keywords options correctly.
        Process ranges correctly so that N-N will run only N.
        Process N-M as M-N if M is smaller than N.
        * tests/autotest.at (Keywords): Unmark XFAIL.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.189
diff -u -r1.189 general.m4
--- lib/autotest/general.m4     27 Jul 2005 14:20:32 -0000      1.189
+++ lib/autotest/general.m4     16 Aug 2005 16:06:45 -0000
@@ -249,7 +249,6 @@
 at_help_all='AT_help_all'])])dnl
 m4_divert_push([PARSE_ARGS])dnl
 
-at_keywords=
 at_prev=
 for at_option
 do
@@ -323,11 +322,15 @@
     [[0-9][0-9][0-9]-[0-9][0-9][0-9]] | \
     [[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] | \
     [[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]] )
-       at_range_start=`expr $at_option : '\([^-]*\)'`
-       at_range_end=`expr $at_option : '[^-]*-\(.*\)'`
-       # FIXME: Maybe test to make sure start <= end?
+       at_range_start=`expr $at_option : '\([[^-]]*\)'`
+       at_range_end=`expr $at_option : '[[^-]]*-\(.*\)'`
+       if test $at_range_start -gt $at_range_end; then
+         at_tmp=$at_range_end
+         at_range_end=$at_range_start
+         at_range_start=$at_tmp
+       fi
        at_range=`echo " $at_groups_all " | \
-         sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \
+         sed -e 's,^.* '$at_range_start' , '$at_range_start' ,' \
              -e 's, '$at_range_end' .*$, '$at_range_end','`
        at_groups="$at_groups$at_range "
        ;;
@@ -337,7 +340,17 @@
        at_prev=--keywords
        ;;
     --keywords=* )
-       at_keywords="$at_keywords,$at_optarg"
+       at_groups_selected=$at_help_all
+       for at_keyword in `IFS=,; set X $at_optarg; shift; echo address@hidden
+       do
+               # It is on purpose that we match the test group titles too.
+               at_groups_selected=`echo "$at_groups_selected" |
+               grep -i "^[[^;]]*;[[^;]]*.*[[; ]]$at_keyword[[ ;]]"`
+       done
+       at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
+       # Smash the end of lines.
+       at_groups_selected=`echo $at_groups_selected`
+       at_groups="$at_groups$at_groups_selected "
        ;;
 m4_divert_pop([PARSE_ARGS])dnl
 dnl Process *=* last to allow for user specified --option=* type arguments.
@@ -362,23 +375,10 @@
   esac
 done
 
-# Process the --keywords
-if test -n "$at_keywords"; then
-  at_groups_selected=$at_help_all
-  for at_keyword in `IFS=,; set X $at_keywords; shift; echo address@hidden
-  do
-    # It is on purpose that we match the test group titles too.
-    at_groups_selected=`echo "$at_groups_selected" |
-                       grep -i "^[[^;]]*;[[^;]]*.*[[; ]]$at_keyword[[ ;]]"`
-  done
-  at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
-  # Smash the end of lines.
-  at_groups_selected=`echo $at_groups_selected`
-  at_groups="$at_groups$at_groups_selected "
-fi
-
 # Selected test groups.
-test -z "$at_groups" && at_groups=$at_groups_all
+if test -z "$at_groups"; then
+  at_groups=$at_groups_all
+fi
 m4_divert_pop([PARSE_ARGS_END])dnl
 m4_divert_push([HELP])dnl
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]