Codebase list libclass-c3-xs-perl / 3394271
* New upstream release * Add myself to Uploaders and Copyright * Upgrade to new short debhelper rules format * Refresh copyright file * Standards-Version 3.8.3 (drop perl version dependency) * Rewrite control description * Now Recommends libclass-c3-xs-perl -- this should probably become Depends, but I'm not sure. It can technically be used on its own, but it is not intended to be. Jonathan Yu 14 years ago
16 changed file(s) with 337 addition(s) and 181 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension Class::C3::XS
1
2 0.13 Thu Sep 24, 2009
3 - Release 0.12_03 as a stable release, without further modifications.
4
5 0.12_03 Mon Sep 21, 2009
6 - Fix compatibility with perl 5.6.x. Thanks again, Nicholas.
7
8 0.12_02 Mon Sep 7, 2009
9 - Actually ship with the changes 0.12_01 claimed to have. Thanks for
10 catching this, Nicholas.
11
12 0.12_01 Sat Aug 22, 2009
13 - Backport a couple of performance tweaks from bleadperl. This gives a
14 performance improvement of about 40% in calculating the linearized
15 isa for hierarchies with single parents only.
116
217 0.11 Mon Mar 30, 2009
318 - Define SVfARG if the perl we're compiling for doesn't have
22 author:
33 - 'Brandon L. Black, <blblack@gmail.com>'
44 build_requires:
5 ExtUtils::MakeMaker: 6.42
56 Test::More: 0.47
67 configure_requires:
7 ExtUtils::MakeMaker: 6.50
8 ExtUtils::MakeMaker: 6.42
89 distribution_type: module
9 generated_by: 'Module::Install version 0.81'
10 generated_by: 'Module::Install version 0.91'
1011 license: perl
1112 meta-spec:
1213 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1920 provides:
2021 Class::C3::XS:
2122 file: lib/Class/C3/XS.pm
22 version: 0.11
23 version: 0.13
2324 requires:
2425 perl: 5.6.0
2526 resources:
2627 license: http://dev.perl.org/licenses/
27 version: 0.11
28 version: 0.13
+66
-14
XS.xs less more
9898 if(isa && AvFILLp(isa) >= 0) {
9999 SV** seqs_ptr;
100100 I32 seqs_items;
101 HV* const tails = (HV*)sv_2mortal((SV*)newHV());
101 HV* tails;
102102 AV* const seqs = (AV*)sv_2mortal((SV*)newAV());
103103 I32* heads;
104104
121121 else {
122122 /* recursion */
123123 AV* const isa_lin = __mro_linear_isa_c3(aTHX_ isa_item_stash, cache, level + 1);
124
125 if(items == 0 && AvFILLp(seqs) == -1) {
126 /* Only one parent class. For this case, the C3
127 linearisation is this class followed by the parent's
128 linearisation, so don't bother with the expensive
129 calculation. */
130 SV **svp;
131 I32 subrv_items = AvFILLp(isa_lin) + 1;
132 SV *const *subrv_p = AvARRAY(isa_lin);
133
134 /* Hijack the allocated but unused array seqs to be the
135 return value. It's currently mortalised. */
136
137 retval = seqs;
138
139 av_extend(retval, subrv_items);
140 AvFILLp(retval) = subrv_items;
141 svp = AvARRAY(retval);
142
143 /* First entry is this class. */
144 *svp++ = newSVpvn(stashname, stashname_len);
145
146 while(subrv_items--) {
147 /* These values are unlikely to be shared hash key
148 scalars, so no point in adding code to optimising
149 for a case that is unlikely to be true.
150 (Or prove me wrong and do it.) */
151
152 SV *const val = *subrv_p++;
153 *svp++ = newSVsv(val);
154 }
155
156 SvREFCNT_dec(isa_lin);
157 SvREFCNT_inc(retval);
158
159 goto done;
160 }
124161 av_push(seqs, (SV*)isa_lin);
125162 }
126163 }
127164 av_push(seqs, SvREFCNT_inc((SV*)isa));
165 tails = (HV*)sv_2mortal((SV*)newHV());
128166
129167 /* This builds "heads", which as an array of integer array
130168 indices, one per seq, which point at the virtual "head"
145183 SV** seq_ptr = AvARRAY(seq) + 1;
146184 while(seq_items--) {
147185 SV* const seqitem = *seq_ptr++;
148 HE* const he = hv_fetch_ent(tails, seqitem, 0, 0);
149 if(!he) {
150 if(!hv_store_ent(tails, seqitem, newSViv(1), 0)) {
151 croak("failed to store value in hash");
186 /* LVALUE fetch will create a new undefined SV if necessary
187 */
188 HE* const he = hv_fetch_ent(tails, seqitem, 1, 0);
189 if(he) {
190 SV* const val = HeVAL(he);
191 /* For 5.8.0 and later, sv_inc() with increment undef to
192 an IV of 1, which is what we want for a newly created
193 entry. However, for 5.6.x it will become an NV of
194 1.0, which confuses the SvIVX() checks above */
195 if(SvIOK(val)) {
196 SvIVX(val)++;
197 } else {
198 sv_setiv(val, 1);
152199 }
153 }
154 else {
155 SV* const val = HeVAL(he);
156 sv_inc(val);
200 } else {
201 croak("failed to store value in hash");
157202 }
158203 }
159204 }
259304 av_push(retval, newSVpvn(stashname, stashname_len));
260305 }
261306
307 done:
262308 /* we don't want anyone modifying the cache entry but us,
263309 and we do so by replacing it completely */
264310 SvREADONLY_on(retval);
366412 }
367413
368414 /* we found a real sub here */
369 sv = sv_2mortal(newSV(0));
415 sv = sv_newmortal();
370416
371417 gv_efullname3(sv, cvgv, NULL);
372418
373 fq_subname = SvPVX(sv);
374 fq_subname_len = SvCUR(sv);
419 if (SvPOK(sv)) {
420 fq_subname = SvPVX(sv);
421 fq_subname_len = SvCUR(sv);
422
423 subname = strrchr(fq_subname, ':');
424 } else {
425 subname = NULL;
426 }
375427
376428 subname = strrchr(fq_subname, ':');
377429 if(!subname)
473525 if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
474526 SvREFCNT_dec(linear_av);
475527 SvREFCNT_inc((SV*)cand_cv);
476 if (!hv_store_ent(nmcache, newSVsv(cachekey), (SV*)cand_cv, 0)) {
528 if (!hv_store_ent(nmcache, cachekey, (SV*)cand_cv, 0)) {
477529 croak("failed to store value in hash");
478530 }
479531 XPUSHs(sv_2mortal(newRV_inc((SV*)cand_cv)));
483535 }
484536
485537 SvREFCNT_dec(linear_av);
486 if (!hv_store_ent(nmcache, newSVsv(cachekey), &PL_sv_undef, 0)) {
538 if (!hv_store_ent(nmcache, cachekey, &PL_sv_undef, 0)) {
487539 croak("failed to store value in hash");
488540 }
489541 if(throw_nomethod)
0 libclass-c3-xs-perl (0.11-2) UNRELEASED; urgency=low
0 libclass-c3-xs-perl (0.13-1) UNRELEASED; urgency=low
11
2 [ Jonathan Yu ]
3 * New upstream release
4 * Add myself to Uploaders and Copyright
5 * Upgrade to new short debhelper rules format
6 * Refresh copyright file
7 * Standards-Version 3.8.3 (drop perl version dependency)
8 * Rewrite control description
9 * Now Recommends libclass-c3-xs-perl -- this should probably become
10 Depends, but I'm not sure. It can technically be used on its own,
11 but it is not intended to be.
12
13 [ Nathan Handler ]
214 * debian/watch: Update to ignore development releases.
315
4 -- Nathan Handler <nhandler@ubuntu.com> Sat, 06 Jun 2009 01:33:07 +0000
16 -- Jonathan Yu <jawnsy@cpan.org> Fri, 25 Sep 2009 05:11:56 -0400
517
618 libclass-c3-xs-perl (0.11-1) unstable; urgency=low
719
00 Source: libclass-c3-xs-perl
11 Section: perl
22 Priority: optional
3 Build-Depends: debhelper (>= 7), perl (>= 5.8.8-7), libtest-pod-perl
3 Build-Depends: perl, debhelper (>= 7), libtest-pod-perl
44 Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
55 Uploaders: Krzysztof Krzyżaniak (eloy) <eloy@debian.org>,
6 Damyan Ivanov <dmn@debian.org>
7 Standards-Version: 3.8.1
6 Damyan Ivanov <dmn@debian.org>, Jonathan Yu <jawnsy@cpan.org>
7 Standards-Version: 3.8.3
88 Homepage: http://search.cpan.org/dist/Class-C3-XS/
99 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libclass-c3-xs-perl/
1010 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libclass-c3-xs-perl/
1212 Package: libclass-c3-xs-perl
1313 Architecture: any
1414 Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}
15 Description: XS speedups for Class::C3
16 Class::C3::XS contains XS performance enhancers for Class::C3 version 0.16
17 and higher. The main Class::C3 package will use this package automatically
18 if it can find it. Do not use this package directly, use Class::C3 instead.
15 Recommends: libclass-c3-perl (>= 0.16)
16 Description: Perl module to accelerate Class::C3
17 Class::C3::XS is a Perl module designed to enhance the performance of the
18 Class::C3 package (see libclass-c3-perl). It does so automatically and is not
19 designed to be used directly; once installed, it should accelerate all programs
20 that make use of Class::C3 itself.
00 Format-Specification:
11 http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
2 Upstream-Maintainer: Brandon L. Black
2 Upstream-Maintainer: Florian Ragwitz <rafl@debian.org>
33 Upstream-Source: http://search.cpan.org/dist/Class-C3-XS/
44 Upstream-Name: Class-C3-XS
55
66 Files: *
7 Author: Brandon L. Black, <blblack@gmail.com>
7 Author: Brandon L. Black <blblack@gmail.com>
88 Copyright: no explicit copyright. ChangeLog shows that the module was
99 developed during 2007 and 2009
10 License: GPL-1+|Artistic
11 This library is free software; you can redistribute it and/or modify
12 it under the same terms as Perl itself.
13 .
14 Perl is distributed under licenses:
15 .
16 a) the GNU General Public License as published by the Free Software
17 Foundation; either version 1, or (at your option) any later
18 version, or
19 .
20 b) the "Artistic License" which comes with Perl.
21 .
22 On Debian GNU/Linux systems, the complete text of the GNU General Public
23 License can be found in /usr/share/common-licenses/GPL' and the Artistic
24 Licence in /usr/share/common-licenses/Artistic'.
10 License: GPL-1+ | Artistic
2511
26 Files: inc/*
27 Copyright: 2002 - 2009 by Brian Ingerson, Audrey Tang and Adam Kennedy.
12 Files: debian/*
13 Copyright: 2009, Jonathan Yu <jawnsy@cpan.org>
14 2008, Damyan Ivanov <dmn@debian.org>
15 2007-2009, Krzysztof Krzyzaniak (eloy) <eloy@debian.org>
16 License: GPL-1+ | Artistic
17 X-Comment: It is assumed that all maintainers license their work as the
18 same as upstream.
19
20 Files: inc/Module/*
21 Copyright: 2002-2009, Adam Kennedy <adamk@cpan.org>
22 2002-2009, Audrey Tang <autrijus@autrijus.org>
23 2002-2009, Brian Ingerson <ingy@cpan.org>
2824 License-Alias: Perl
2925 License: Artistic | GPL-1+
3026
31 Files: debian/*
32 Copyright: © 2007-2009 Krzysztof Krzyzaniak (eloy) <eloy@debian.org>
33 Copyright: © 2007-2009 Debian Perl Group <debian-perl@lists.debian.org>
34 License: other
35 It is assumed that all maintainers license their worh in a manner, compatible
36 with upstream's license.
27 License: Artistic
28 This program is free software; you can redistribute it and/or modify
29 it under the terms of the Artistic License, which comes with Perl.
30 On Debian GNU/Linux systems, the complete text of the Artistic License
31 can be found in `/usr/share/common-licenses/Artistic'
32
33 License: GPL-1+
34 This program is free software; you can redistribute it and/or modify
35 it under the terms of the GNU General Public License as published by
36 the Free Software Foundation; either version 1, or (at your option)
37 any later version.
38 On Debian GNU/Linux systems, the complete text of the GNU General
39 Public License can be found in `/usr/share/common-licenses/GPL'
40
00 #!/usr/bin/make -f
11
2 build: build-stamp
3 build-stamp:
4 dh build
5 touch $@
6
7 clean:
2 %:
83 dh $@
9
10 install: install-stamp
11 install-stamp: build-stamp
12 dh install
13 touch $@
14
15 binary-arch: install
16 dh $@
17
18 binary-indep:
19
20 binary: binary-arch binary-indep
21
22 .PHONY: binary binary-arch binary-indep install clean build
00 #line 1
11 package Module::Install::Base;
22
3 $VERSION = '0.81';
3 use strict 'vars';
4 use vars qw{$VERSION};
5 BEGIN {
6 $VERSION = '0.91';
7 }
48
59 # Suspend handler for "redefined" warnings
610 BEGIN {
812 $SIG{__WARN__} = sub { $w };
913 }
1014
11 ### This is the ONLY module that shouldn't have strict on
12 # use strict;
13
14 #line 41
15 #line 42
1516
1617 sub new {
17 my ($class, %args) = @_;
18
19 foreach my $method ( qw(call load) ) {
20 *{"$class\::$method"} = sub {
21 shift()->_top->$method(@_);
22 } unless defined &{"$class\::$method"};
23 }
24
25 bless( \%args, $class );
18 my $class = shift;
19 unless ( defined &{"${class}::call"} ) {
20 *{"${class}::call"} = sub { shift->_top->call(@_) };
21 }
22 unless ( defined &{"${class}::load"} ) {
23 *{"${class}::load"} = sub { shift->_top->load(@_) };
24 }
25 bless { @_ }, $class;
2626 }
2727
2828 #line 61
2929
3030 sub AUTOLOAD {
31 my $self = shift;
32 local $@;
33 my $autoload = eval { $self->_top->autoload } or return;
34 goto &$autoload;
31 local $@;
32 my $func = eval { shift->_top->autoload } or return;
33 goto &$func;
3534 }
3635
37 #line 76
36 #line 75
3837
39 sub _top { $_[0]->{_top} }
38 sub _top {
39 $_[0]->{_top};
40 }
4041
41 #line 89
42 #line 90
4243
4344 sub admin {
44 $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
45 $_[0]->_top->{admin}
46 or
47 Module::Install::Base::FakeAdmin->new;
4548 }
4649
47 #line 101
50 #line 106
4851
4952 sub is_admin {
50 $_[0]->admin->VERSION;
53 $_[0]->admin->VERSION;
5154 }
5255
5356 sub DESTROY {}
5457
5558 package Module::Install::Base::FakeAdmin;
5659
57 my $Fake;
58 sub new { $Fake ||= bless(\@_, $_[0]) }
60 my $fake;
61
62 sub new {
63 $fake ||= bless(\@_, $_[0]);
64 }
5965
6066 sub AUTOLOAD {}
6167
6874
6975 1;
7076
71 #line 146
77 #line 154
11 package Module::Install::Can;
22
33 use strict;
4 use Module::Install::Base;
5 use Config ();
6 use File::Spec ();
7 use ExtUtils::MakeMaker ();
4 use Config ();
5 use File::Spec ();
6 use ExtUtils::MakeMaker ();
7 use Module::Install::Base ();
88
9 use vars qw{$VERSION $ISCORE @ISA};
9 use vars qw{$VERSION @ISA $ISCORE};
1010 BEGIN {
11 $VERSION = '0.81';
11 $VERSION = '0.91';
12 @ISA = 'Module::Install::Base';
1213 $ISCORE = 1;
13 @ISA = qw{Module::Install::Base};
1414 }
1515
1616 # check if we can load some module
11 package Module::Install::Fetch;
22
33 use strict;
4 use Module::Install::Base;
4 use Module::Install::Base ();
55
6 use vars qw{$VERSION $ISCORE @ISA};
6 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '0.81';
8 $VERSION = '0.91';
9 @ISA = 'Module::Install::Base';
910 $ISCORE = 1;
10 @ISA = qw{Module::Install::Base};
1111 }
1212
1313 sub get_file {
11 package Module::Install::Makefile;
22
33 use strict 'vars';
4 use Module::Install::Base;
5 use ExtUtils::MakeMaker ();
6
7 use vars qw{$VERSION $ISCORE @ISA};
4 use ExtUtils::MakeMaker ();
5 use Module::Install::Base ();
6
7 use vars qw{$VERSION @ISA $ISCORE};
88 BEGIN {
9 $VERSION = '0.81';
9 $VERSION = '0.91';
10 @ISA = 'Module::Install::Base';
1011 $ISCORE = 1;
11 @ISA = qw{Module::Install::Base};
1212 }
1313
1414 sub Makefile { $_[0] }
113113 my $self = shift;
114114 die "&Makefile->write() takes no arguments\n" if @_;
115115
116 # Make sure we have a new enough
116 # Check the current Perl version
117 my $perl_version = $self->perl_version;
118 if ( $perl_version ) {
119 eval "use $perl_version; 1"
120 or die "ERROR: perl: Version $] is installed, "
121 . "but we need version >= $perl_version";
122 }
123
124 # Make sure we have a new enough MakeMaker
117125 require ExtUtils::MakeMaker;
118126
119 # MakeMaker can complain about module versions that include
120 # an underscore, even though its own version may contain one!
121 # Hence the funny regexp to get rid of it. See RT #35800
122 # for details.
123
124 $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
125
126 # Generate the
127 if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
128 # MakeMaker can complain about module versions that include
129 # an underscore, even though its own version may contain one!
130 # Hence the funny regexp to get rid of it. See RT #35800
131 # for details.
132 $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
133 $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
134 } else {
135 # Allow legacy-compatibility with 5.005 by depending on the
136 # most recent EU:MM that supported 5.005.
137 $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
138 $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
139 }
140
141 # Generate the MakeMaker params
127142 my $args = $self->makemaker_args;
128143 $args->{DISTNAME} = $self->name;
129144 $args->{NAME} = $self->module_name || $self->name;
132147 if ( $self->tests ) {
133148 $args->{test} = { TESTS => $self->tests };
134149 }
135 if ($] >= 5.005) {
150 if ( $] >= 5.005 ) {
136151 $args->{ABSTRACT} = $self->abstract;
137152 $args->{AUTHOR} = $self->author;
138153 }
146161 delete $args->{SIGN};
147162 }
148163
149 # merge both kinds of requires into prereq_pm
164 # Merge both kinds of requires into prereq_pm
150165 my $prereq = ($args->{PREREQ_PM} ||= {});
151166 %$prereq = ( %$prereq,
152167 map { @$_ }
249264
250265 __END__
251266
252 #line 379
267 #line 394
11 package Module::Install::Metadata;
22
33 use strict 'vars';
4 use Module::Install::Base;
4 use Module::Install::Base ();
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '0.81';
9 @ISA = qw{Module::Install::Base};
8 $VERSION = '0.91';
9 @ISA = 'Module::Install::Base';
1010 $ISCORE = 1;
1111 }
1212
1313 my @boolean_keys = qw{
1414 sign
15 mymeta
1615 };
1716
1817 my @scalar_keys = qw{
439438 /ixms ) {
440439 my $license_text = $1;
441440 my @phrases = (
442 'under the same (?:terms|license) as perl itself' => 'perl', 1,
443 'GNU general public license' => 'gpl', 1,
444 'GNU public license' => 'gpl', 1,
445 'GNU lesser general public license' => 'lgpl', 1,
446 'GNU lesser public license' => 'lgpl', 1,
447 'GNU library general public license' => 'lgpl', 1,
448 'GNU library public license' => 'lgpl', 1,
449 'BSD license' => 'bsd', 1,
450 'Artistic license' => 'artistic', 1,
451 'GPL' => 'gpl', 1,
452 'LGPL' => 'lgpl', 1,
453 'BSD' => 'bsd', 1,
454 'Artistic' => 'artistic', 1,
455 'MIT' => 'mit', 1,
456 'proprietary' => 'proprietary', 0,
441 'under the same (?:terms|license) as (?:perl|the perl programming language) itself' => 'perl', 1,
442 'GNU general public license' => 'gpl', 1,
443 'GNU public license' => 'gpl', 1,
444 'GNU lesser general public license' => 'lgpl', 1,
445 'GNU lesser public license' => 'lgpl', 1,
446 'GNU library general public license' => 'lgpl', 1,
447 'GNU library public license' => 'lgpl', 1,
448 'BSD license' => 'bsd', 1,
449 'Artistic license' => 'artistic', 1,
450 'GPL' => 'gpl', 1,
451 'LGPL' => 'lgpl', 1,
452 'BSD' => 'bsd', 1,
453 'Artistic' => 'artistic', 1,
454 'MIT' => 'mit', 1,
455 'proprietary' => 'proprietary', 0,
457456 );
458457 while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
459458 $pattern =~ s{\s+}{\\s+}g;
505504 }
506505 }
507506
507 sub test_requires_from {
508 my $self = shift;
509 my $content = Module::Install::_readperl($_[0]);
510 my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
511 while ( @requires ) {
512 my $module = shift @requires;
513 my $version = shift @requires;
514 $self->test_requires( $module => $version );
515 }
516 }
517
508518 # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
509519 # numbers (eg, 5.006001 or 5.008009).
510520 # Also, convert double-part versions (eg, 5.8)
511521 sub _perl_version {
512522 my $v = $_[-1];
513 $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
523 $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
514524 $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
515525 $v =~ s/(\.\d\d\d)000$/$1/;
516526 $v =~ s/_.+$//;
517527 if ( ref($v) ) {
518 $v = $v + 0; # Numify
528 # Numify
529 $v = $v + 0;
519530 }
520531 return $v;
521532 }
525536
526537
527538 ######################################################################
528 # MYMETA.yml Support
539 # MYMETA Support
529540
530541 sub WriteMyMeta {
531542 die "WriteMyMeta has been deprecated";
532543 }
533544
534 sub write_mymeta {
535 my $self = shift;
536
537 # If there's no existing META.yml there is nothing we can do
538 return unless -f 'META.yml';
545 sub write_mymeta_yaml {
546 my $self = shift;
539547
540548 # We need YAML::Tiny to write the MYMETA.yml file
541549 unless ( eval { require YAML::Tiny; 1; } ) {
542550 return 1;
551 }
552
553 # Generate the data
554 my $meta = $self->_write_mymeta_data or return 1;
555
556 # Save as the MYMETA.yml file
557 print "Writing MYMETA.yml\n";
558 YAML::Tiny::DumpFile('MYMETA.yml', $meta);
559 }
560
561 sub write_mymeta_json {
562 my $self = shift;
563
564 # We need JSON to write the MYMETA.json file
565 unless ( eval { require JSON; 1; } ) {
566 return 1;
567 }
568
569 # Generate the data
570 my $meta = $self->_write_mymeta_data or return 1;
571
572 # Save as the MYMETA.yml file
573 print "Writing MYMETA.json\n";
574 Module::Install::_write(
575 'MYMETA.json',
576 JSON->new->pretty(1)->canonical->encode($meta),
577 );
578 }
579
580 sub _write_mymeta_data {
581 my $self = shift;
582
583 # If there's no existing META.yml there is nothing we can do
584 return undef unless -f 'META.yml';
585
586 # We need Parse::CPAN::Meta to load the file
587 unless ( eval { require Parse::CPAN::Meta; 1; } ) {
588 return undef;
543589 }
544590
545591 # Merge the perl version into the dependencies
557603 }
558604
559605 # Load the advisory META.yml file
560 my @yaml = YAML::Tiny::LoadFile('META.yml');
606 my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
561607 my $meta = $yaml[0];
562608
563609 # Overwrite the non-configure dependency hashs
571617 $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
572618 }
573619
574 # Save as the MYMETA.yml file
575 print "Writing MYMETA.yml\n";
576 YAML::Tiny::DumpFile('MYMETA.yml', $meta);
620 return $meta;
577621 }
578622
579623 1;
11 package Module::Install::Win32;
22
33 use strict;
4 use Module::Install::Base;
4 use Module::Install::Base ();
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '0.81';
9 @ISA = qw{Module::Install::Base};
8 $VERSION = '0.91';
9 @ISA = 'Module::Install::Base';
1010 $ISCORE = 1;
1111 }
1212
11 package Module::Install::WriteAll;
22
33 use strict;
4 use Module::Install::Base;
4 use Module::Install::Base ();
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '0.81';
8 $VERSION = '0.91';;
99 @ISA = qw{Module::Install::Base};
1010 $ISCORE = 1;
1111 }
4040
4141 # The Makefile write process adds a couple of dependencies,
4242 # so write the META.yml files after the Makefile.
43 $self->Meta->write if $args{meta};
44 $self->Meta->write_mymeta if $self->mymeta;
43 if ( $args{meta} ) {
44 $self->Meta->write;
45 }
46
47 # Experimental support for MYMETA
48 if ( $ENV{X_MYMETA} ) {
49 if ( $ENV{X_MYMETA} eq 'JSON' ) {
50 $self->Meta->write_mymeta_json;
51 } else {
52 $self->Meta->write_mymeta_yaml;
53 }
54 }
4555
4656 return 1;
4757 }
1616 # 3. The ./inc/ version of Module::Install loads
1717 # }
1818
19 BEGIN {
20 require 5.004;
21 }
19 use 5.005;
2220 use strict 'vars';
2321
24 use vars qw{$VERSION};
22 use vars qw{$VERSION $MAIN};
2523 BEGIN {
2624 # All Module::Install core packages now require synchronised versions.
2725 # This will be used to ensure we don't accidentally load old or
2927 # This is not enforced yet, but will be some time in the next few
3028 # releases once we can make sure it won't clash with custom
3129 # Module::Install extensions.
32 $VERSION = '0.81';
30 $VERSION = '0.91';
31
32 # Storage for the pseudo-singleton
33 $MAIN = undef;
3334
3435 *inc::Module::Install::VERSION = *VERSION;
3536 @inc::Module::Install::ISA = __PACKAGE__;
9293
9394
9495
96
9597 # Build.PL was formerly supported, but no longer is due to excessive
9698 # difficulty in implementing every single feature twice.
9799 if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
130132 $sym->{$cwd} = sub {
131133 my $pwd = Cwd::cwd();
132134 if ( my $code = $sym->{$pwd} ) {
133 # delegate back to parent dirs
135 # Delegate back to parent dirs
134136 goto &$code unless $cwd eq $pwd;
135137 }
136138 $$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
137 unless ( uc($1) eq $1 ) {
138 unshift @_, ( $self, $1 );
139 goto &{$self->can('call')};
139 my $method = $1;
140 if ( uc($method) eq $method ) {
141 # Do nothing
142 return;
143 } elsif ( $method =~ /^_/ and $self->can($method) ) {
144 # Dispatch to the root M:I class
145 return $self->$method(@_);
140146 }
147
148 # Dispatch to the appropriate plugin
149 unshift @_, ( $self, $1 );
150 goto &{$self->can('call')};
141151 };
142152 }
143153
162172 delete $INC{"$self->{file}"};
163173 delete $INC{"$self->{path}.pm"};
164174
175 # Save to the singleton
176 $MAIN = $self;
177
165178 return 1;
166179 }
167180
175188
176189 my @exts = @{$self->{extensions}};
177190 unless ( @exts ) {
178 my $admin = $self->{admin};
179 @exts = $admin->load_all_extensions;
191 @exts = $self->{admin}->load_all_extensions;
180192 }
181193
182194 my %seen;
259271 sub load_extensions {
260272 my ($self, $path, $top) = @_;
261273
262 unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
274 unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
263275 unshift @INC, $self->{prefix};
264276 }
265277
340352 if ( $] >= 5.006 ) {
341353 open( FH, '<', $_[0] ) or die "open($_[0]): $!";
342354 } else {
343 open( FH, "< $_[0]" ) or die "open($_[0]): $!";
355 open( FH, "< $_[0]" ) or die "open($_[0]): $!";
344356 }
345357 my $string = do { local $/; <FH> };
346358 close FH or die "close($_[0]): $!";
371383 if ( $] >= 5.006 ) {
372384 open( FH, '>', $_[0] ) or die "open($_[0]): $!";
373385 } else {
374 open( FH, "> $_[0]" ) or die "open($_[0]): $!";
386 open( FH, "> $_[0]" ) or die "open($_[0]): $!";
375387 }
376388 foreach ( 1 .. $#_ ) {
377389 print FH $_[$_] or die "print($_[0]): $!";
33 use strict;
44 use warnings;
55
6 our $VERSION = '0.11';
6 our $VERSION = '0.13';
77
88 =pod
99
4646 require XSLoader;
4747 XSLoader::load('Class::C3::XS', $VERSION);
4848
49 $VERSION = eval $VERSION;
50
4951 package # hide me from PAUSE
5052 next;
5153