You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/11/16 14:57:04 UTC
svn commit: r475738 - /spamassassin/branches/jm_re2c_hacks/sa-compile.raw
Author: jm
Date: Thu Nov 16 05:57:04 2006
New Revision: 475738
URL: http://svn.apache.org/viewvc?view=rev&rev=475738
Log:
fix usage to work on sa-compile script
Modified:
spamassassin/branches/jm_re2c_hacks/sa-compile.raw
Modified: spamassassin/branches/jm_re2c_hacks/sa-compile.raw
URL: http://svn.apache.org/viewvc/spamassassin/branches/jm_re2c_hacks/sa-compile.raw?view=diff&rev=475738&r1=475737&r2=475738
==============================================================================
--- spamassassin/branches/jm_re2c_hacks/sa-compile.raw (original)
+++ spamassassin/branches/jm_re2c_hacks/sa-compile.raw Thu Nov 16 05:57:04 2006
@@ -56,6 +56,7 @@
use Getopt::Long;
use File::Copy;
use File::Path;
+use Pod::Usage;
use vars qw( %opt );
Mail::SpamAssassin::Util::clean_path_in_taint_mode();
@@ -89,6 +90,21 @@
exit 0;
}
+sub usage {
+ my ( $exitval, $message ) = @_;
+ $exitval ||= 64;
+
+ if ($exitval == 0) {
+ print_version();
+ print("\n");
+ }
+ pod2usage(
+ -verbose => 0,
+ -message => $message,
+ -exitval => $exitval,
+ );
+}
+
# set debug areas, if any specified (only useful for command-line tools)
if (defined $opt{'debug'}) {
$opt{'debug'} ||= 'all';
@@ -513,7 +529,7 @@
close($re);
open(FILE, ">$PMFILE") || die "write $PMFILE: $!";
- print FILE <<"EOT";
+ my $str =<<"EOT";
package $modname;
@@ -537,18 +553,18 @@
1;
__END__
-=head1 NAME
+fnord=head1 NAME
$modname - Efficient string matching for regexps found in $FILE
-=head1 SYNOPSIS
+fnord=head1 SYNOPSIS
use $modname;
...
my \$match = ${modname}::scan(\$string);
-=head1 DESCRIPTION
+fnord=head1 DESCRIPTION
This module was created by SpamAssassin with the aid of re2xs, which uses re2c
to create an XS library capable of scanning through a bunch of regular
@@ -558,6 +574,9 @@
=cut
EOT
+
+$str =~ s/^fnord=/=/gs;
+ print FILE $str;
}