.gear/rules | 2 + .../tags/3014c6563571a589267b68e06b6f8a6d61f4e8f5 | 13 ++ .gear/tags/list | 1 + Call/Call.pm | 7 +- Call/Call.xs | 3 +- Exec/Exec.pm | 7 +- Exec/Exec.xs | 3 +- Makefile.PL | 141 +------------------- Makefile.PL.orig | 141 ++++++++++++++++++++ decrypt/decrypt.pm | 7 +- decrypt/decrypt.xs | 3 +- perl-Filter.spec | 63 +++++++++ tee/tee.pm | 7 +- 13 files changed, 236 insertions(+), 162 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..271ecfc --- /dev/null +++ b/.gear/rules @@ -0,0 +1,2 @@ +tar: @version@:. name=Filter-@version@ +diff: @version@:. . name=perl-Filter-@version@-@release@.patch diff --git a/.gear/tags/3014c6563571a589267b68e06b6f8a6d61f4e8f5 b/.gear/tags/3014c6563571a589267b68e06b6f8a6d61f4e8f5 new file mode 100644 index 0000000..cac2bf2 --- /dev/null +++ b/.gear/tags/3014c6563571a589267b68e06b6f8a6d61f4e8f5 @@ -0,0 +1,13 @@ +object 4154e30670b7b078a009bbbabd2507cc753e0595 +type commit +tag 1.37 +tagger Alexey Tourbin 1284928866 +0400 + +1.37 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAkyWdWIACgkQfBKgtDjnu0bo3gCdEoJceEKAVj/xdeIiL1ojyP9A +4LIAnjR559hyBjUtWIjX5kfv1omswhGC +=PYDI +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..11c3cea --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +3014c6563571a589267b68e06b6f8a6d61f4e8f5 1.37 diff --git a/Call/Call.pm b/Call/Call.pm index 1d1b261..1832bfa 100644 --- a/Call/Call.pm +++ b/Call/Call.pm @@ -8,15 +8,13 @@ package Filter::Util::Call ; -require 5.005 ; -require DynaLoader; require Exporter; use Carp ; use strict; use warnings; use vars qw($VERSION @ISA @EXPORT) ; -@ISA = qw(Exporter DynaLoader); +@ISA = qw(Exporter); @EXPORT = qw( filter_add filter_del filter_read filter_read_exact) ; $VERSION = "1.08" ; @@ -56,7 +54,8 @@ sub filter_add($) Filter::Util::Call::real_import($obj, (caller)[0], $coderef) ; } -bootstrap Filter::Util::Call ; +require XSLoader; +XSLoader::load(__PACKAGE__, $VERSION); 1; __END__ diff --git a/Call/Call.xs b/Call/Call.xs index f115d92..2561a66 100644 --- a/Call/Call.xs +++ b/Call/Call.xs @@ -53,7 +53,6 @@ filter_call(pTHX_ int idx, SV *buf_sv, int maxlen) { dMY_CXT; SV *my_sv = FILTER_DATA(idx); - const char *nl = "\n"; char *p; char *out_ptr; int n; @@ -88,7 +87,7 @@ filter_call(pTHX_ int idx, SV *buf_sv, int maxlen) } else { /* want lines */ - if ((p = ninstr(out_ptr, out_ptr + n, nl, nl + 1))) { + if ((p = memchr(out_ptr, '\n', n))) { sv_catpvn(buf_sv, out_ptr, p - out_ptr + 1); diff --git a/Exec/Exec.pm b/Exec/Exec.pm index 9d1150a..9e87c1f 100644 --- a/Exec/Exec.pm +++ b/Exec/Exec.pm @@ -1,14 +1,13 @@ package Filter::Util::Exec ; require 5.002 ; -require DynaLoader; use strict; use warnings; -use vars qw(@ISA $VERSION) ; -@ISA = qw(DynaLoader); +use vars qw($VERSION) ; $VERSION = "1.03" ; -bootstrap Filter::Util::Exec ; +require XSLoader; +XSLoader::load(__PACKAGE__, $VERSION); 1 ; __END__ diff --git a/Exec/Exec.xs b/Exec/Exec.xs index 2b7ae13..561c4ea 100644 --- a/Exec/Exec.xs +++ b/Exec/Exec.xs @@ -488,7 +488,6 @@ filter_exec(pTHX_ int idx, SV *buf_sv, int maxlen) char * out_ptr = SvPVX(buffer) ; int n ; char * p ; - char * nl = "\n" ; if (fdebug) warn ("filter_sh(idx=%d, SvCUR(buf_sv)=%d, maxlen=%d\n", @@ -520,7 +519,7 @@ filter_exec(pTHX_ int idx, SV *buf_sv, int maxlen) /* want a line */ if (fdebug) warn("filter_sh(%d) - wants a line\n", idx) ; - if (p = ninstr(out_ptr, out_ptr + n, nl, nl + 1)) { + if ((p = memchr(out_ptr, '\n', n))) { sv_catpvn(buf_sv, out_ptr, p - out_ptr + 1); n = n - (p - out_ptr + 1); BUF_OFFSET(buffer) += (p - out_ptr + 1); diff --git a/Makefile.PL b/Makefile.PL index c460899..9a49fdd 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,141 +1,2 @@ use ExtUtils::MakeMaker; - -BEGIN -{ - die "Filters needs Perl version 5.005 or better, you have $]\n" - if $] < 5.005 ; - - warn "Perl 5.6.0 or better is strongly recommended for Win32\n" - if $^O eq 'MSWin32' && $] < 5.006 ; -} - -use strict; - -my @files = qw( filter-util.pl - Call/Call.pm - Exec/Exec.pm - decrypt/decrypt.pm decrypt/decr decrypt/encrypt - tee/tee.pm - lib/Filter/cpp.pm lib/Filter/exec.pm lib/Filter/sh.pm - examples/filtdef - examples/method/Count.pm - examples/method/NewSubst.pm - examples/method/UUdecode.pm - examples/method/Decompress.pm - examples/method/Joe2Jim.pm - examples/method/Subst.pm - examples/closure/Count.pm - examples/closure/NewSubst.pm - examples/closure/UUdecode.pm - examples/closure/Decompress.pm - examples/closure/Include.pm - examples/closure/Joe2Jim.pm - examples/closure/Subst.pm - examples/filtdef - examples/filtuu - t/call.t - t/cpp.t - t/decrypt.t - t/exec.t - t/order.t - t/sh.t - t/tee.t - ); - -if ($] < 5.006001) - { oldWarnings(@files) } -else - { newWarnings(@files) } - - -WriteMakefile( - NAME => 'Filter', - VERSION => '1.37', - 'linkext' => {LINKTYPE => ''}, - 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz', - DIST_DEFAULT => 'tardist'}, - ($] >= 5.005 - ? (ABSTRACT => 'Source Filters', - AUTHOR => 'Paul Marquess ') - : () - ), - - INSTALLDIRS => ($] >= 5.00703 ? 'perl' : 'site'), - - ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? - ('LICENSE' => 'perl') : ()), - ) ; - -sub MY::libscan -{ - my $self = shift ; - my $path = shift ; - - return undef - if $path =~ /(~|\.bak)$/ || - $path =~ /^\..*\.swp$/ ; - - return $path; -} - -#sub MY::postamble -#{ -# ' -# -#MyDoubleCheck: -# @echo Checking for $$^W in files -# @perl -ne \' \ -# exit 1 if /^\s*local\s*\(\s*\$$\^W\s*\)/; \ -# \' ' . " @files || " . ' \ -# (echo found unexpected $$^W ; exit 1) -# @echo All is ok. -# -#' ; -#} - -sub oldWarnings -{ - local ($^I) = ".bak" ; - local (@ARGV) = @_ ; - - while (<>) - { - if (/^__END__/) - { - print ; - my $this = $ARGV ; - while (<>) - { - last if $ARGV ne $this ; - print ; - } - } - - s/^(\s*)(no\s+warnings)/${1}local (\$^W) = 0; #$2/ ; - s/^(\s*)(use\s+warnings)/${1}local (\$^W) = 1; #$2/ ; - print ; - } -} - -sub newWarnings -{ - local ($^I) = ".bak" ; - local (@ARGV) = @_ ; - - while (<>) - { - if (/^__END__/) - { - my $this = $ARGV ; - print ; - while (<>) - { - last if $ARGV ne $this ; - print ; - } - } - - s/^(\s*)local\s*\(\$\^W\)\s*=\s*\d+\s*;\s*#\s*((no|use)\s+warnings.*)/$1$2/ ; - print ; - } -} +WriteMakefile(NAME => 'Filter'); diff --git a/Makefile.PL.orig b/Makefile.PL.orig new file mode 100644 index 0000000..c460899 --- /dev/null +++ b/Makefile.PL.orig @@ -0,0 +1,141 @@ +use ExtUtils::MakeMaker; + +BEGIN +{ + die "Filters needs Perl version 5.005 or better, you have $]\n" + if $] < 5.005 ; + + warn "Perl 5.6.0 or better is strongly recommended for Win32\n" + if $^O eq 'MSWin32' && $] < 5.006 ; +} + +use strict; + +my @files = qw( filter-util.pl + Call/Call.pm + Exec/Exec.pm + decrypt/decrypt.pm decrypt/decr decrypt/encrypt + tee/tee.pm + lib/Filter/cpp.pm lib/Filter/exec.pm lib/Filter/sh.pm + examples/filtdef + examples/method/Count.pm + examples/method/NewSubst.pm + examples/method/UUdecode.pm + examples/method/Decompress.pm + examples/method/Joe2Jim.pm + examples/method/Subst.pm + examples/closure/Count.pm + examples/closure/NewSubst.pm + examples/closure/UUdecode.pm + examples/closure/Decompress.pm + examples/closure/Include.pm + examples/closure/Joe2Jim.pm + examples/closure/Subst.pm + examples/filtdef + examples/filtuu + t/call.t + t/cpp.t + t/decrypt.t + t/exec.t + t/order.t + t/sh.t + t/tee.t + ); + +if ($] < 5.006001) + { oldWarnings(@files) } +else + { newWarnings(@files) } + + +WriteMakefile( + NAME => 'Filter', + VERSION => '1.37', + 'linkext' => {LINKTYPE => ''}, + 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz', + DIST_DEFAULT => 'tardist'}, + ($] >= 5.005 + ? (ABSTRACT => 'Source Filters', + AUTHOR => 'Paul Marquess ') + : () + ), + + INSTALLDIRS => ($] >= 5.00703 ? 'perl' : 'site'), + + ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? + ('LICENSE' => 'perl') : ()), + ) ; + +sub MY::libscan +{ + my $self = shift ; + my $path = shift ; + + return undef + if $path =~ /(~|\.bak)$/ || + $path =~ /^\..*\.swp$/ ; + + return $path; +} + +#sub MY::postamble +#{ +# ' +# +#MyDoubleCheck: +# @echo Checking for $$^W in files +# @perl -ne \' \ +# exit 1 if /^\s*local\s*\(\s*\$$\^W\s*\)/; \ +# \' ' . " @files || " . ' \ +# (echo found unexpected $$^W ; exit 1) +# @echo All is ok. +# +#' ; +#} + +sub oldWarnings +{ + local ($^I) = ".bak" ; + local (@ARGV) = @_ ; + + while (<>) + { + if (/^__END__/) + { + print ; + my $this = $ARGV ; + while (<>) + { + last if $ARGV ne $this ; + print ; + } + } + + s/^(\s*)(no\s+warnings)/${1}local (\$^W) = 0; #$2/ ; + s/^(\s*)(use\s+warnings)/${1}local (\$^W) = 1; #$2/ ; + print ; + } +} + +sub newWarnings +{ + local ($^I) = ".bak" ; + local (@ARGV) = @_ ; + + while (<>) + { + if (/^__END__/) + { + my $this = $ARGV ; + print ; + while (<>) + { + last if $ARGV ne $this ; + print ; + } + } + + s/^(\s*)local\s*\(\$\^W\)\s*=\s*\d+\s*;\s*#\s*((no|use)\s+warnings.*)/$1$2/ ; + print ; + } +} diff --git a/decrypt/decrypt.pm b/decrypt/decrypt.pm index c0d1acb..4fe238a 100644 --- a/decrypt/decrypt.pm +++ b/decrypt/decrypt.pm @@ -1,14 +1,13 @@ package Filter::decrypt ; require 5.002 ; -require DynaLoader; use strict; use warnings; -use vars qw(@ISA $VERSION); -@ISA = qw(DynaLoader); +use vars qw($VERSION); $VERSION = "1.05" ; -bootstrap Filter::decrypt ; +require XSLoader; +XSLoader::load(__PACKAGE__, $VERSION); 1; __END__ diff --git a/decrypt/decrypt.xs b/decrypt/decrypt.xs index 61113be..c60bbc9 100644 --- a/decrypt/decrypt.xs +++ b/decrypt/decrypt.xs @@ -137,7 +137,6 @@ static I32 filter_decrypt(pTHX_ int idx, SV *buf_sv, int maxlen) { SV *my_sv = FILTER_DATA(idx); - char *nl = "\n"; char *p; char *out_ptr; int n; @@ -194,7 +193,7 @@ filter_decrypt(pTHX_ int idx, SV *buf_sv, int maxlen) } else { /* want lines */ - if ((p = ninstr(out_ptr, out_ptr + n, nl, nl + 1))) { + if ((p = memchr(out_ptr, '\n', n))) { sv_catpvn(buf_sv, out_ptr, p - out_ptr + 1); diff --git a/perl-Filter.spec b/perl-Filter.spec new file mode 100644 index 0000000..49eaa4e --- /dev/null +++ b/perl-Filter.spec @@ -0,0 +1,63 @@ +%define dist Filter +Name: perl-%dist +Version: 1.37 +Release: alt1 + +Summary: Source Filters +License: GPL or Artistic +Group: Development/Perl + +URL: %CPAN %dist +Source: %dist-%version.tar +Patch: %name-%version-%release.patch + +# Automatically added by buildreq on Mon Sep 20 2010 +BuildRequires: perl-devel + +%description +Source filters alter the program text of a module before Perl sees it, +much as a C preprocessor alters the source text of a C program before +the compiler sees it. + +%prep +%setup -q -n %dist-%version +%patch -p1 + +%ifdef __buildreqs +mv t/pod.t t/pod.t.orig +%endif + +%build +%perl_vendor_build + +%install +%perl_vendor_install + +%files +%doc Changes README + %perl_vendor_archlib/Filter + %perl_vendor_autolib/Filter + +%changelog +* Mon Sep 20 2010 Alexey Tourbin 1.37-alt1 +- 1.36 -> 1.37 +- built for perl-5.12 +- disabled build dependency on perl-Test-Pod + +* Tue Mar 03 2009 Alexey Tourbin 1.36-alt1 +- 1.34 -> 1.36 + +* Tue Aug 21 2007 Alexey Tourbin 1.34-alt1 +- 1.32 -> 1.34 +- perlfilter.pod not packaged (a copy in perl-pod is better) + +* Wed Feb 28 2007 Alexey Tourbin 1.32-alt2 +- imported into git and adapted for gear +- replaced DynaLoader with XSLoader +- replaced Perl_ninstr() with memchr(3) + +* Mon Aug 07 2006 Alexey Tourbin 1.32-alt1 +- 1.30 -> 1.32 + +* Tue Dec 14 2004 Alexey Tourbin 1.30-alt1 +- initial revision (split off from perl-base) diff --git a/tee/tee.pm b/tee/tee.pm index 7d73812..96c70b8 100644 --- a/tee/tee.pm +++ b/tee/tee.pm @@ -1,14 +1,13 @@ package Filter::tee ; require 5.002; -require DynaLoader; use strict; use warnings; -use vars qw( @ISA $VERSION); -@ISA = qw(DynaLoader); +use vars qw($VERSION); $VERSION = "1.02" ; -bootstrap Filter::tee ; +require XSLoader; +XSLoader::load(__PACKAGE__, $VERSION); 1; __END__