From: Ævar Arnfjörð Bjarmason Date: Thu, 17 May 2007 23:26:00 +0000 (+0000) Subject: Importing re-engine-Plugin-0.03.tar.gz X-Git-Tag: v0.03^2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=447aa9bcb55632cf669454868679169602a28fe2;p=perl%2Fmodules%2Fre-engine-Plugin.git Importing re-engine-Plugin-0.03.tar.gz --- diff --git a/ChangeLog b/ChangeLog index 12ce24f..50a3310 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-17 Ævar Arnfjörð Bjarmason (0.03) + + * Plugin.xs: The exec callback would call_sv on a NULL value + causing a segfault + * Plugin.pod: Use %hash ~~ 'i' instead of $hash{i}, more stylish! + * inc: Bumping Module::Install to 0.65 + 2007-05-17 Ævar Arnfjörð Bjarmason (0.02) * Brought up to date with current blead after lots of hacking on diff --git a/META.yml b/META.yml index cf689cb..b334027 100644 --- a/META.yml +++ b/META.yml @@ -1,15 +1,19 @@ -abstract: Regular Expression engine API -author: "\xC3\x86var Arnfj\xC3\xB6r\xC3\xB0 Bjarmason " -build_requires: +--- +abstract: API to write custom regex engines +author: 'Ævar Arnfjörð Bjarmason ' +build_requires: Test::More: 0 distribution_type: module -generated_by: Module::Install version 0.64 +generated_by: Module::Install version 0.65 license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.3.html + version: 1.3 name: re-engine-Plugin -no_index: - directory: +no_index: + directory: - inc - t -requires: +requires: perl: 5.9.5 -tests: t/*.t +tests: t/*.t t/*/*.t t/*/*/*.t diff --git a/Plugin.pm b/Plugin.pm index c693c44..220dfdf 100644 --- a/Plugin.pm +++ b/Plugin.pm @@ -5,7 +5,7 @@ use base 'Regexp'; use strict; use XSLoader (); -our $VERSION = '0.02'; +our $VERSION = '0.03'; XSLoader::load __PACKAGE__, $VERSION; diff --git a/Plugin.pod b/Plugin.pod index d4bb1a2..3ae9882 100644 --- a/Plugin.pod +++ b/Plugin.pod @@ -149,7 +149,7 @@ hashrefs, objects, etc. =head2 mod my %mod = $rx->mod; - say "has /ix" if $mod{i} and $mod{x}; + say "has /ix" if %mod ~~ 'i' and %mod ~~ 'x'; A key-value pair list of the modifiers the pattern was compiled with. The keys will zero or more of C and the values will be true diff --git a/Plugin.xs b/Plugin.xs index e9d1307..aa95e8b 100644 --- a/Plugin.xs +++ b/Plugin.xs @@ -126,32 +126,36 @@ Plugin_exec(pTHX_ REGEXP * const rx, char *stringarg, char *strend, SV * callback = get_H_callback("exec"); GET_SELF_FROM_PPRIVATE(rx->pprivate); - /* Store the current str for ->str */ - self->str = (SV*)sv; - SvREFCNT_inc(self->str); + if (callback) { + /* Store the current str for ->str */ + self->str = (SV*)sv; + SvREFCNT_inc(self->str); - ENTER; - SAVETMPS; + ENTER; + SAVETMPS; - PUSHMARK(SP); - XPUSHs(rx->pprivate); - XPUSHs(sv); - PUTBACK; + PUSHMARK(SP); + XPUSHs(rx->pprivate); + XPUSHs(sv); + PUTBACK; - call_sv(callback, G_SCALAR); + call_sv(callback, G_SCALAR); - SPAGAIN; + SPAGAIN; - SV * ret = POPs; + SV * ret = POPs; - if (SvTRUE(ret)) - matched = 1; - else - matched = 0; + if (SvTRUE(ret)) + matched = 1; + else + matched = 0; - PUTBACK; - FREETMPS; - LEAVE; + PUTBACK; + FREETMPS; + LEAVE; + } else { + matched = 0; + } return matched; } diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm index 0330b0e..af6a59c 100644 --- a/inc/Module/Install.pm +++ b/inc/Module/Install.pm @@ -28,7 +28,7 @@ BEGIN { # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '0.64'; + $VERSION = '0.65'; } # Whether or not inc::Module::Install is actually loaded, the diff --git a/inc/Module/Install/AutoInstall.pm b/inc/Module/Install/AutoInstall.pm index f36f564..b4b55af 100644 --- a/inc/Module/Install/AutoInstall.pm +++ b/inc/Module/Install/AutoInstall.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm index 30a24ca..b46a8ca 100644 --- a/inc/Module/Install/Base.pm +++ b/inc/Module/Install/Base.pm @@ -1,7 +1,7 @@ #line 1 package Module::Install::Base; -$VERSION = '0.64'; +$VERSION = '0.65'; # Suspend handler for "redefined" warnings BEGIN { diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm index 1c01e22..9bcf278 100644 --- a/inc/Module/Install/Can.pm +++ b/inc/Module/Install/Can.pm @@ -11,7 +11,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm index 24c0c02..0d2c39c 100644 --- a/inc/Module/Install/Fetch.pm +++ b/inc/Module/Install/Fetch.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm index f4c83a3..964b93d 100644 --- a/inc/Module/Install/Include.pm +++ b/inc/Module/Install/Include.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm index 96c7e17..eb67033 100644 --- a/inc/Module/Install/Makefile.pm +++ b/inc/Module/Install/Makefile.pm @@ -7,7 +7,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } @@ -136,9 +136,13 @@ sub write { . "but we need version >= $perl_version"; } + $args->{INSTALLDIRS} = $self->installdirs; + my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args; - if ($self->admin->preop) { - $args{dist} = $self->admin->preop; + + my $user_preop = delete $args{dist}->{PREOP}; + if (my $preop = $self->admin->preop($user_preop)) { + $args{dist} = $preop; } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); @@ -205,4 +209,4 @@ sub postamble { __END__ -#line 334 +#line 338 diff --git a/inc/Module/Install/Makefile/Version.pm b/inc/Module/Install/Makefile/Version.pm index d5dc7e0..349afc0 100644 --- a/inc/Module/Install/Makefile/Version.pm +++ b/inc/Module/Install/Makefile/Version.pm @@ -4,7 +4,7 @@ package Module::Install::Makefile::Version; use Module::Install::Base; @ISA = qw(Module::Install::Base); -$VERSION = '0.64'; +$VERSION = '0.65'; use strict; diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm index 6c80832..b5658c9 100644 --- a/inc/Module/Install/Metadata.pm +++ b/inc/Module/Install/Metadata.pm @@ -6,14 +6,14 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } my @scalar_keys = qw{ name module_name abstract author version license - distribution_type perl_version tests + distribution_type perl_version tests installdirs }; my @tuple_keys = qw{ @@ -56,6 +56,11 @@ foreach my $key (@tuple_keys) { }; } +sub install_as_core { $_[0]->installdirs('perl') } +sub install_as_cpan { $_[0]->installdirs('site') } +sub install_as_site { $_[0]->installdirs('site') } +sub install_as_vendor { $_[0]->installdirs('vendor') } + sub sign { my $self = shift; return $self->{'values'}{'sign'} if defined wantarray and !@_; @@ -279,9 +284,11 @@ sub license_from { if ( $self->_slurp($file) =~ m/ - =head \d \s+ - (?:licen[cs]e|licensing|copyright|legal)\b - (.*?) + ( + =head \d \s+ + (?:licen[cs]e|licensing|copyright|legal)\b + .*? + ) (=head\\d.*|=cut.*|) \z /ixms @@ -298,6 +305,7 @@ sub license_from { 'LGPL' => 'lgpl', 'BSD' => 'bsd', 'Artistic' => 'artistic', + 'MIT' => 'MIT', ); while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) { $pattern =~ s{\s+}{\\s+}g; diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm index 2ec7d66..42cb653 100644 --- a/inc/Module/Install/Win32.pm +++ b/inc/Module/Install/Win32.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm index 3546e61..d0908fb 100644 --- a/inc/Module/Install/WriteAll.pm +++ b/inc/Module/Install/WriteAll.pm @@ -6,7 +6,7 @@ use Module::Install::Base; use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '0.64'; + $VERSION = '0.65'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; }