autoconf-patches
[Top][All Lists]
Advanced

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

FYI: FileUtils and ChannelDefs in Autoconf


From: Akim Demaille
Subject: FYI: FileUtils and ChannelDefs in Autoconf
Date: Thu, 21 Aug 2003 18:17:47 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * lib/Autom4te/FileUtils.pm (&find_file): Walk the @include in
        forward order.
        * lib/Autom4te/ChannelDefs.pm: Doc typos.
        (&parse_warnings): Accept a list of warning requests.
        (&usage): Return a string, not a side effect.
        (cross): New warning category.

Index: lib/Autom4te/FileUtils.pm
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/FileUtils.pm,v
retrieving revision 1.2
diff -u -u -r1.2 FileUtils.pm
--- lib/Autom4te/FileUtils.pm 20 Aug 2003 12:52:19 -0000 1.2
+++ lib/Autom4te/FileUtils.pm 21 Aug 2003 16:15:04 -0000
@@ -83,7 +83,7 @@
       return undef;
     }
 
-  foreach my $path (reverse @include)
+  foreach my $path (@include)
     {
       return File::Spec->canonpath (File::Spec->catfile ($path, $filename))
        if -e File::Spec->catfile ($path, $filename)
Index: lib/Autom4te/ChannelDefs.pm
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/Autom4te/ChannelDefs.pm,v
retrieving revision 1.1
diff -u -u -r1.1 ChannelDefs.pm
--- lib/Autom4te/ChannelDefs.pm 20 Aug 2003 06:51:34 -0000 1.1
+++ lib/Autom4te/ChannelDefs.pm 21 Aug 2003 16:15:04 -0000
@@ -27,7 +27,7 @@
 
   use Autom4te::ChannelDefs;
 
-  Autom4te::ChannelDefs::usage ();
+  print Autom4te::ChannelDefs::usage (), "\n";
   prog_error ($MESSAGE, [%OPTIONS]);
   error ($WHERE, $MESSAGE, [%OPTIONS]);
   error ($MESSAGE);
@@ -36,7 +36,7 @@
   verb ($MESSAGE, [%OPTIONS]);
   switch_warning ($CATEGORY);
   parse_WARNINGS ();
-  parse_warning ($OPTION, $ARGUMENT);
+  parse_warnings ($OPTION, $ARGUMENT);
   Autom4te::ChannelDefs::set_strictness ($STRICTNESS_NAME);
 
 =head1 DESCRIPTION
@@ -80,7 +80,7 @@
 
 =item C<error-gnu/warn>
 
-Errors related to GNU Standards that should be warnings in `foreign' mode.
+Errors related to GNU Standards that should be warnings in "foreign" mode.
 
 =item C<error-gnits>
 
@@ -90,6 +90,10 @@
 
 Internal errors.  Use C<&prog_error> to send messages over this channel.
 
+=item C<cross>
+
+Constructs compromising the cross-compilation of the package.
+
 =item C<gnu>
 
 Warnings related to GNU Coding Standards.
@@ -142,6 +146,7 @@
             "####################\n"),
   footer => "\nPlease contact <address@hidden>.";
 
+register_channel 'cross', type => 'warning', silent => 1;
 register_channel 'gnu', type => 'warning';
 register_channel 'obsolete', type => 'warning', silent => 1;
 register_channel 'override', type => 'warning', silent => 1;
@@ -158,13 +163,14 @@
 
 =item C<usage ()>
 
-Display warning categories.
+Return the warning category descriptions.
 
 =cut
 
 sub usage ()
 {
-  print "Warning categories include:
+  return "Warning categories include:
+  `cross'         cross compilation issues
   `gnu'           GNU coding standards (default in gnu and gnits modes)
   `obsolete'      obsolete features or constructions
   `override'      user redefinitions of Automake rules or variables
@@ -174,8 +180,7 @@
   `all'           all the warnings
   `no-CATEGORY'   turn off warnings in CATEGORY
   `none'          turn off all the warnings
-  `error'         treat warnings as errors
-";
+  `error'         treat warnings as errors";
 }
 
 =item C<prog_error ($MESSAGE, [%OPTIONS])>
@@ -234,7 +239,7 @@
 =item C<switch_warning ($CATEGORY)>
 
 If C<$CATEGORY> is C<mumble>, turn on channel C<mumble>.
-If it's C<no-mumble>, turn C<mumble> off.
+If it is C<no-mumble>, turn C<mumble> off.
 Else handle C<all> and C<none> for completeness.
 
 =cut
@@ -293,21 +298,22 @@
     }
 }
 
-=item C<parse_warning ($OPTION, $ARGUMENT)>
+=item C<parse_warnings ($OPTION, @ARGUMENT)>
 
 Parse the argument of C<--warning=CATEGORY> or C<-WCATEGORY>.
 
-C<$OPTIONS> is C<"--warning"> or C<"-W">, C<$ARGUMENT> is C<CATEGORY>.
+C<$OPTIONS> is C<"--warning"> or C<"-W">, C<@ARGUMENT> is a list of
+C<CATEGORY>.
 
-This is meant to be used as a argument to C<Getopt>.
+This can be used as a argument to C<Getopt>.
 
 =cut
 
-sub parse_warnings ($$)
+sub parse_warnings ($@)
 {
-  my ($opt, $categories) = @_;
+  my ($opt, @categories) = @_;
 
-  foreach my $cat (split (',', $categories))
+  foreach my $cat (map { split ',' } @categories)
     {
       msg 'unsupported', "unknown warning category `$cat'"
        if switch_warning $cat;




reply via email to

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