Imported Upstream version 0.73
Salvatore Bonaccorso
10 years ago
0 | [Changes for 0.73 - Wed Jun 5 23:44:57 CST 2013] | |
1 | ||
2 | * Properly redo the previous fix using File::Spec->file_name_is_absolute. | |
3 | ||
4 | [Changes for 0.72 - Wed Jun 5 23:19:02 CST 2013] | |
5 | ||
6 | * Only allow loading Digest::* from absolute paths in @INC, | |
7 | by ensuring they begin with \ or / characters. | |
8 | ||
9 | Contributed by: Florian Weimer (CVE-2013-2145) | |
10 | ||
11 | [Changes for 0.71 - Tue Jun 4 18:24:10 CST 2013] | |
12 | ||
13 | * Constrain the user-specified digest name to /^\w+\d+$/. | |
14 | ||
15 | * Avoid loading Digest::* from relative paths in @INC. | |
16 | ||
17 | Contributed by: Florian Weimer (CVE-2013-2145) | |
18 | ||
19 | [Changes for 0.70 - Thu Nov 29 01:45:54 CST 2012] | |
20 | ||
21 | * Don't check gpg version if gpg does not exist. | |
22 | ||
23 | This avoids unnecessary warnings during installation | |
24 | when gpg executable is not installed. | |
25 | ||
26 | Contributed by: Kenichi Ishigaki | |
27 | ||
28 | [Changes for 0.69 - Fri Nov 2 23:04:19 CST 2012] | |
29 | ||
30 | * Support for gpg under these alternate names: | |
31 | ||
32 | gpg gpg2 gnupg gnupg2 | |
33 | ||
34 | Contributed by: Michael Schwern | |
35 | ||
0 | 36 | [Changes for 0.68 - Fri, 13 May 2011 11:51:50 +0200] |
1 | 37 | |
2 | 38 | * Fix breakage introduced by 0.67 (Andreas König). |
2 | 2 | author: |
3 | 3 | - '唐鳳 <cpan@audreyt.org>' |
4 | 4 | build_requires: |
5 | ExtUtils::MakeMaker: 6.42 | |
5 | ExtUtils::MakeMaker: 6.36 | |
6 | 6 | IPC::Run: 0 |
7 | 7 | Test::More: 0 |
8 | 8 | configure_requires: |
9 | ExtUtils::MakeMaker: 6.42 | |
9 | ExtUtils::MakeMaker: 6.36 | |
10 | 10 | distribution_type: module |
11 | generated_by: 'Module::Install version 1.00' | |
11 | dynamic_config: 1 | |
12 | generated_by: 'Module::Install version 1.06' | |
12 | 13 | license: cc0 |
13 | 14 | meta-spec: |
14 | 15 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
23 | 24 | perl: 5.005 |
24 | 25 | resources: |
25 | 26 | repository: http://github.com/audreyt/module-signature |
26 | version: 0.68 | |
27 | version: 0.73 |
0 | use strict; | |
0 | 1 | use inc::Module::Install 0.92; |
1 | 2 | |
2 | 3 | $|++; |
65 | 66 | # dependencies so they will upgrade as needed. |
66 | 67 | requires( @OPEN_PGP ); |
67 | 68 | |
68 | } elsif ( locate_gpg() ) { | |
69 | } elsif ( my $gpg = locate_gpg() ) { | |
69 | 70 | # We SHOULD have gpg, double-check formally |
70 | requires_external_bin 'gpg'; | |
71 | ||
71 | requires_external_bin $gpg; | |
72 | 72 | } elsif ( can_cc() and $ENV{AUTOMATED_TESTING} ) { |
73 | 73 | # Dive headlong into a full Crypt::OpenPGP install. |
74 | 74 | requires( @OPEN_PGP ); |
97 | 97 | sub locate_gpg { |
98 | 98 | print "Looking for GNU Privacy Guard (gpg), a cryptographic signature tool...\n"; |
99 | 99 | |
100 | my $gpg = can_run('gpg'); | |
101 | my $has_gpg = ( | |
102 | $gpg and | |
103 | `gpg --version` =~ /GnuPG/ | |
104 | ); | |
105 | ||
106 | unless ( $has_gpg ) { | |
100 | my ($gpg, $gpg_path); | |
101 | for my $gpg_bin ('gpg', 'gpg2', 'gnupg', 'gnupg2') { | |
102 | $gpg_path = can_run($gpg_bin); | |
103 | next unless $gpg_path; | |
104 | next unless `$gpg_bin --version` =~ /GnuPG/; | |
105 | next unless defined `$gpg_bin --list-public-keys`; | |
106 | ||
107 | $gpg = $gpg_bin; | |
108 | last; | |
109 | } | |
110 | unless ( $gpg ) { | |
107 | 111 | print "gpg not found.\n"; |
108 | 112 | return; |
109 | 113 | } |
110 | 114 | |
111 | print "GnuPG found ($gpg).\n"; | |
115 | print "GnuPG found ($gpg_path).\n"; | |
112 | 116 | |
113 | 117 | return 1 if grep { /^--installdeps/} @ARGV; |
114 | 118 | |
115 | 119 | if ( prompt("Import PAUSE and author keys to GnuPG?", 'y' ) =~ /^y/i) { |
116 | 120 | print 'Importing... '; |
117 | system 'gpg', '--quiet', '--import', glob('*.pub'); | |
121 | system $gpg, '--quiet', '--import', glob('*.pub'); | |
118 | 122 | print "done.\n"; |
119 | 123 | } |
120 | 124 | |
121 | return 1; | |
125 | return $gpg; | |
122 | 126 | } |
123 | 127 | |
124 | 128 | sub ask_user { |
244 | 244 | |
245 | 245 | Module::Install, ExtUtils::MakeMaker, Module::Build |
246 | 246 | |
247 | Dist::Zilla::Plugin::Signature | |
248 | ||
247 | 249 | AUTHORS |
248 | 250 | 唐鳳 <cpan@audreyt.org> |
249 | 251 |
0 | 0 | This file contains message digests of all files listed in MANIFEST, |
1 | signed via the Module::Signature module, version 0.68. | |
1 | signed via the Module::Signature module, version 0.73. | |
2 | 2 | |
3 | 3 | To verify the content in this distribution, first make sure you have |
4 | 4 | Module::Signature installed, then type: |
15 | 15 | |
16 | 16 | SHA1 0b722678d07c66ef6992f2cc2c9e9acf3bef0ecb AUDREY2006.pub |
17 | 17 | SHA1 1e2b550757ebdf3ef2c0e8d1d06bcbb9c6b62a6f AUTHORS |
18 | SHA1 9dcc6558459cdbe474dcf325eb9e8eeb68815897 Changes | |
18 | SHA1 fb3ceeacbd691a2dfa63f0b22be04eb67817971c Changes | |
19 | 19 | SHA1 366ad23151d9113e37f4a9edd4d3304ecc30b9d6 MANIFEST |
20 | 20 | SHA1 af1667da11736451592aeba46d34e38c47a7201c MANIFEST.SKIP |
21 | SHA1 f38db924b0216aaff4ccf18247a62997acb447ce META.yml | |
22 | SHA1 0024aa3f23ac84a928c4063e9435ca1607984e7e Makefile.PL | |
21 | SHA1 1728bd49673df420cf1be5a93e8e95bfa6ad18ad META.yml | |
22 | SHA1 3670c5391c41935eb113a75dcf190646a83eb553 Makefile.PL | |
23 | 23 | SHA1 37e858c51409a297ef5d3fb35dc57cd3b57f9a4d PAUSE2003.pub |
24 | SHA1 955ba924e9cd1bafccb4d6d7bd3be25c3ce8bf75 README | |
25 | SHA1 7305dbe2904416e28decb05396988a5d51d578be inc/Module/Install.pm | |
26 | SHA1 129960509127732258570c122042bc48615222e1 inc/Module/Install/Base.pm | |
27 | SHA1 cf3356ed9a5bd2f732527ef9e7bc5ef4458c8a93 inc/Module/Install/Can.pm | |
28 | SHA1 e083a5ec82c708f0a933785388b3ac2c94d802ec inc/Module/Install/External.pm | |
29 | SHA1 bf0a3e1977effc2832d7a813a76dce3f31b437b6 inc/Module/Install/Fetch.pm | |
30 | SHA1 b721c93ca5bc9a6aa863b49af15f1b1de6125935 inc/Module/Install/Makefile.pm | |
31 | SHA1 026cc0551a0ad399d195e395b46bdf842e115192 inc/Module/Install/Metadata.pm | |
32 | SHA1 d3a33569b41077d6a836f95bb63484c51e9d0a52 inc/Module/Install/ReadmeFromPod.pm | |
33 | SHA1 d3a4c720c6ec7f8fce7df37002fbc9177fb77050 inc/Module/Install/Scripts.pm | |
34 | SHA1 5457015ea5a50e93465bf2dafa29feebd547f85b inc/Module/Install/Win32.pm | |
35 | SHA1 051e7fa8063908befa3440508d0584a2497b97db inc/Module/Install/WriteAll.pm | |
36 | SHA1 e37281f2715f3a73c830d0408461fc0e3e43d419 lib/Module/Signature.pm | |
24 | SHA1 6135b90837836cd8a72c78cbec211b2d84996c99 README | |
25 | SHA1 8a924add836b60fb23b25c8506d45945e02f42f4 inc/Module/Install.pm | |
26 | SHA1 2d0fad3bf255f8c1e7e1e34eafccc4f595603ddc inc/Module/Install/Base.pm | |
27 | SHA1 f0e01fff7d73cd145fbf22331579918d4628ddb0 inc/Module/Install/Can.pm | |
28 | SHA1 272e65bd98dd43c7acd8c272dde84fbe5794fc07 inc/Module/Install/External.pm | |
29 | SHA1 7328966e4fda0c8451a6d3850704da0b84ac1540 inc/Module/Install/Fetch.pm | |
30 | SHA1 b62ca5e2d58fa66766ccf4d64574f9e1a2250b34 inc/Module/Install/Makefile.pm | |
31 | SHA1 1aa925be410bb3bfcd84a16985921f66073cc1d2 inc/Module/Install/Metadata.pm | |
32 | SHA1 dc94326a076aca41452c1d65bf52a255feeb9ef7 inc/Module/Install/ReadmeFromPod.pm | |
33 | SHA1 4d793c044726e06fe35d8d129b76da2803377f92 inc/Module/Install/Scripts.pm | |
34 | SHA1 e4196994fa75e98bdfa2be0bdeeffef66de88171 inc/Module/Install/Win32.pm | |
35 | SHA1 c3a6d0d5b84feb3280622e9599e86247d58b0d18 inc/Module/Install/WriteAll.pm | |
36 | SHA1 6c5cda03253ec382b7f558f891d2f4868a235610 lib/Module/Signature.pm | |
37 | 37 | SHA1 0882c50213a28b7a30fc91fd58c19015f33348d0 script/cpansign |
38 | 38 | SHA1 3ec6171779122b0bdc69937c283be11b2a15dd89 t/0-signature.t |
39 | 39 | SHA1 307a744384e704d94031df73233f24174b843bc8 t/1-basic.t |
42 | 42 | SHA1 69614dfba33a1ef498a2161f9e4718092652857c t/wrap.pl |
43 | 43 | SHA1 61377898e9d7cb06d370f45167a925e16736de70 t/wrapped-tests.bin |
44 | 44 | -----BEGIN PGP SIGNATURE----- |
45 | Version: GnuPG v1.4.11 (GNU/Linux) | |
45 | Version: GnuPG v1.4.12 (Darwin) | |
46 | 46 | |
47 | iEYEARECAAYFAk3M/5gACgkQdC8qQo5jWl6ejwCfYy2EE94jsoe1oY2w7Na3jSnX | |
48 | 1fwAnRgS45SDoKjbLSH1+6z37NL/MpGI | |
49 | =NYb6 | |
47 | iEYEARECAAYFAlGvpckACgkQtLPdNzw1AaCR9wCfZp9kU2M8/1xG/5Nac1G7g4dH | |
48 | rFwAnA5VfZ1qA17gOZF/sn/sRUhI6LwL | |
49 | =aUN8 | |
50 | 50 | -----END PGP SIGNATURE----- |
3 | 3 | use strict 'vars'; |
4 | 4 | use vars qw{$VERSION}; |
5 | 5 | BEGIN { |
6 | $VERSION = '1.00'; | |
6 | $VERSION = '1.06'; | |
7 | 7 | } |
8 | 8 | |
9 | 9 | # Suspend handler for "redefined" warnings |
2 | 2 | |
3 | 3 | use strict; |
4 | 4 | use Config (); |
5 | use File::Spec (); | |
6 | 5 | use ExtUtils::MakeMaker (); |
7 | 6 | use Module::Install::Base (); |
8 | 7 | |
9 | 8 | use vars qw{$VERSION @ISA $ISCORE}; |
10 | 9 | BEGIN { |
11 | $VERSION = '1.00'; | |
10 | $VERSION = '1.06'; | |
12 | 11 | @ISA = 'Module::Install::Base'; |
13 | 12 | $ISCORE = 1; |
14 | 13 | } |
28 | 27 | eval { require $mod; $pkg->VERSION($ver || 0); 1 }; |
29 | 28 | } |
30 | 29 | |
31 | # check if we can run some command | |
30 | # Check if we can run some command | |
32 | 31 | sub can_run { |
33 | 32 | my ($self, $cmd) = @_; |
34 | 33 | |
37 | 36 | |
38 | 37 | for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { |
39 | 38 | next if $dir eq ''; |
40 | my $abs = File::Spec->catfile($dir, $_[1]); | |
39 | require File::Spec; | |
40 | my $abs = File::Spec->catfile($dir, $cmd); | |
41 | 41 | return $abs if (-x $abs or $abs = MM->maybe_command($abs)); |
42 | 42 | } |
43 | 43 | |
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
47 | # can we locate a (the) C compiler | |
47 | # Can our C compiler environment build XS files | |
48 | sub can_xs { | |
49 | my $self = shift; | |
50 | ||
51 | # Ensure we have the CBuilder module | |
52 | $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); | |
53 | ||
54 | # Do we have the configure_requires checker? | |
55 | local $@; | |
56 | eval "require ExtUtils::CBuilder;"; | |
57 | if ( $@ ) { | |
58 | # They don't obey configure_requires, so it is | |
59 | # someone old and delicate. Try to avoid hurting | |
60 | # them by falling back to an older simpler test. | |
61 | return $self->can_cc(); | |
62 | } | |
63 | ||
64 | # Do we have a working C compiler | |
65 | my $builder = ExtUtils::CBuilder->new( | |
66 | quiet => 1, | |
67 | ); | |
68 | unless ( $builder->have_compiler ) { | |
69 | # No working C compiler | |
70 | return 0; | |
71 | } | |
72 | ||
73 | # Write a C file representative of what XS becomes | |
74 | require File::Temp; | |
75 | my ( $FH, $tmpfile ) = File::Temp::tempfile( | |
76 | "compilexs-XXXXX", | |
77 | SUFFIX => '.c', | |
78 | ); | |
79 | binmode $FH; | |
80 | print $FH <<'END_C'; | |
81 | #include "EXTERN.h" | |
82 | #include "perl.h" | |
83 | #include "XSUB.h" | |
84 | ||
85 | int main(int argc, char **argv) { | |
86 | return 0; | |
87 | } | |
88 | ||
89 | int boot_sanexs() { | |
90 | return 1; | |
91 | } | |
92 | ||
93 | END_C | |
94 | close $FH; | |
95 | ||
96 | # Can the C compiler access the same headers XS does | |
97 | my @libs = (); | |
98 | my $object = undef; | |
99 | eval { | |
100 | local $^W = 0; | |
101 | $object = $builder->compile( | |
102 | source => $tmpfile, | |
103 | ); | |
104 | @libs = $builder->link( | |
105 | objects => $object, | |
106 | module_name => 'sanexs', | |
107 | ); | |
108 | }; | |
109 | my $result = $@ ? 0 : 1; | |
110 | ||
111 | # Clean up all the build files | |
112 | foreach ( $tmpfile, $object, @libs ) { | |
113 | next unless defined $_; | |
114 | 1 while unlink; | |
115 | } | |
116 | ||
117 | return $result; | |
118 | } | |
119 | ||
120 | # Can we locate a (the) C compiler | |
48 | 121 | sub can_cc { |
49 | 122 | my $self = shift; |
50 | 123 | my @chunks = split(/ /, $Config::Config{cc}) or return; |
77 | 150 | |
78 | 151 | __END__ |
79 | 152 | |
80 | #line 156 | |
153 | #line 236 |
7 | 7 | |
8 | 8 | use vars qw{$VERSION $ISCORE @ISA}; |
9 | 9 | BEGIN { |
10 | $VERSION = '1.00'; | |
10 | $VERSION = '1.06'; | |
11 | 11 | $ISCORE = 1; |
12 | 12 | @ISA = qw{Module::Install::Base}; |
13 | } | |
14 | ||
15 | sub requires_xs { | |
16 | my $self = shift; | |
17 | ||
18 | # First check for the basic C compiler | |
19 | $self->requires_external_cc; | |
20 | ||
21 | # We need a C compiler that can build XS files | |
22 | unless ( $self->can_xs ) { | |
23 | print "Unresolvable missing external dependency.\n"; | |
24 | print "This package requires perl's header files.\n"; | |
25 | print STDERR "NA: Unable to build distribution on this platform.\n"; | |
26 | exit(0); | |
27 | } | |
28 | ||
29 | 1; | |
13 | 30 | } |
14 | 31 | |
15 | 32 | sub requires_external_cc { |
40 | 57 | $self->load('can_run'); |
41 | 58 | |
42 | 59 | # Locate the bin |
43 | print "Locating required external dependency bin:$bin..."; | |
60 | print "Locating bin:$bin..."; | |
44 | 61 | my $found_bin = $self->can_run( $bin ); |
45 | 62 | if ( $found_bin ) { |
46 | 63 | print " found at $found_bin.\n"; |
62 | 79 | |
63 | 80 | __END__ |
64 | 81 | |
65 | #line 138 | |
82 | #line 171 |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.00'; | |
8 | $VERSION = '1.06'; | |
9 | 9 | @ISA = 'Module::Install::Base'; |
10 | 10 | $ISCORE = 1; |
11 | 11 | } |
7 | 7 | |
8 | 8 | use vars qw{$VERSION @ISA $ISCORE}; |
9 | 9 | BEGIN { |
10 | $VERSION = '1.00'; | |
10 | $VERSION = '1.06'; | |
11 | 11 | @ISA = 'Module::Install::Base'; |
12 | 12 | $ISCORE = 1; |
13 | 13 | } |
214 | 214 | require ExtUtils::MakeMaker; |
215 | 215 | |
216 | 216 | if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { |
217 | # MakeMaker can complain about module versions that include | |
218 | # an underscore, even though its own version may contain one! | |
219 | # Hence the funny regexp to get rid of it. See RT #35800 | |
220 | # for details. | |
221 | my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; | |
222 | $self->build_requires( 'ExtUtils::MakeMaker' => $v ); | |
223 | $self->configure_requires( 'ExtUtils::MakeMaker' => $v ); | |
217 | # This previous attempted to inherit the version of | |
218 | # ExtUtils::MakeMaker in use by the module author, but this | |
219 | # was found to be untenable as some authors build releases | |
220 | # using future dev versions of EU:MM that nobody else has. | |
221 | # Instead, #toolchain suggests we use 6.59 which is the most | |
222 | # stable version on CPAN at time of writing and is, to quote | |
223 | # ribasushi, "not terminally fucked, > and tested enough". | |
224 | # TODO: We will now need to maintain this over time to push | |
225 | # the version up as new versions are released. | |
226 | $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); | |
227 | $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); | |
224 | 228 | } else { |
225 | 229 | # Allow legacy-compatibility with 5.005 by depending on the |
226 | 230 | # most recent EU:MM that supported 5.005. |
227 | $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); | |
228 | $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); | |
231 | $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); | |
232 | $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); | |
229 | 233 | } |
230 | 234 | |
231 | 235 | # Generate the MakeMaker params |
240 | 244 | 'all_from' if you prefer) in Makefile.PL. |
241 | 245 | EOT |
242 | 246 | |
243 | $DB::single = 1; | |
244 | 247 | if ( $self->tests ) { |
245 | 248 | my @tests = split ' ', $self->tests; |
246 | 249 | my %seen; |
411 | 414 | |
412 | 415 | __END__ |
413 | 416 | |
414 | #line 541 | |
417 | #line 544 |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.00'; | |
8 | $VERSION = '1.06'; | |
9 | 9 | @ISA = 'Module::Install::Base'; |
10 | 10 | $ISCORE = 1; |
11 | 11 | } |
150 | 150 | sub install_as_vendor { $_[0]->installdirs('vendor') } |
151 | 151 | |
152 | 152 | sub dynamic_config { |
153 | my $self = shift; | |
154 | unless ( @_ ) { | |
155 | warn "You MUST provide an explicit true/false value to dynamic_config\n"; | |
156 | return $self; | |
157 | } | |
158 | $self->{values}->{dynamic_config} = $_[0] ? 1 : 0; | |
153 | my $self = shift; | |
154 | my $value = @_ ? shift : 1; | |
155 | if ( $self->{values}->{dynamic_config} ) { | |
156 | # Once dynamic we never change to static, for safety | |
157 | return 0; | |
158 | } | |
159 | $self->{values}->{dynamic_config} = $value ? 1 : 0; | |
159 | 160 | return 1; |
161 | } | |
162 | ||
163 | # Convenience command | |
164 | sub static_config { | |
165 | shift->dynamic_config(0); | |
160 | 166 | } |
161 | 167 | |
162 | 168 | sub perl_version { |
169 | 175 | # Normalize the version |
170 | 176 | $version = $self->_perl_version($version); |
171 | 177 | |
172 | # We don't support the reall old versions | |
178 | # We don't support the really old versions | |
173 | 179 | unless ( $version >= 5.005 ) { |
174 | 180 | die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; |
175 | 181 | } |
514 | 520 | 'GNU Free Documentation license' => 'unrestricted', 1, |
515 | 521 | 'GNU Affero General Public License' => 'open_source', 1, |
516 | 522 | '(?:Free)?BSD license' => 'bsd', 1, |
523 | 'Artistic license 2\.0' => 'artistic_2', 1, | |
517 | 524 | 'Artistic license' => 'artistic', 1, |
518 | 525 | 'Apache (?:Software )?license' => 'apache', 1, |
519 | 526 | 'GPL' => 'gpl', 1, |
549 | 556 | |
550 | 557 | sub _extract_bugtracker { |
551 | 558 | my @links = $_[0] =~ m#L<( |
552 | \Qhttp://rt.cpan.org/\E[^>]+| | |
553 | \Qhttp://github.com/\E[\w_]+/[\w_]+/issues| | |
554 | \Qhttp://code.google.com/p/\E[\w_\-]+/issues/list | |
559 | https?\Q://rt.cpan.org/\E[^>]+| | |
560 | https?\Q://github.com/\E[\w_]+/[\w_]+/issues| | |
561 | https?\Q://code.google.com/p/\E[\w_\-]+/issues/list | |
555 | 562 | )>#gx; |
556 | 563 | my %links; |
557 | 564 | @links{@links}=(); |
580 | 587 | sub requires_from { |
581 | 588 | my $self = shift; |
582 | 589 | my $content = Module::Install::_readperl($_[0]); |
583 | my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; | |
590 | my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; | |
584 | 591 | while ( @requires ) { |
585 | 592 | my $module = shift @requires; |
586 | 593 | my $version = shift @requires; |
6 | 6 | use base qw(Module::Install::Base); |
7 | 7 | use vars qw($VERSION); |
8 | 8 | |
9 | $VERSION = '0.12'; | |
9 | $VERSION = '0.20'; | |
10 | 10 | |
11 | 11 | sub readme_from { |
12 | 12 | my $self = shift; |
13 | 13 | return unless $self->is_admin; |
14 | 14 | |
15 | my $file = shift || $self->_all_from | |
15 | # Input file | |
16 | my $in_file = shift || $self->_all_from | |
16 | 17 | or die "Can't determine file to make readme_from"; |
17 | my $clean = shift; | |
18 | 18 | |
19 | print "Writing README from $file\n"; | |
19 | # Get optional arguments | |
20 | my ($clean, $format, $out_file, $options); | |
21 | my $args = shift; | |
22 | if ( ref $args ) { | |
23 | # Arguments are in a hashref | |
24 | if ( ref($args) ne 'HASH' ) { | |
25 | die "Expected a hashref but got a ".ref($args)."\n"; | |
26 | } else { | |
27 | $clean = $args->{'clean'}; | |
28 | $format = $args->{'format'}; | |
29 | $out_file = $args->{'output_file'}; | |
30 | $options = $args->{'options'}; | |
31 | } | |
32 | } else { | |
33 | # Arguments are in a list | |
34 | $clean = $args; | |
35 | $format = shift; | |
36 | $out_file = shift; | |
37 | $options = \@_; | |
38 | } | |
20 | 39 | |
21 | require Pod::Text; | |
22 | my $parser = Pod::Text->new(); | |
23 | open README, '> README' or die "$!\n"; | |
24 | $parser->output_fh( *README ); | |
25 | $parser->parse_file( $file ); | |
40 | # Default values; | |
41 | $clean ||= 0; | |
42 | $format ||= 'txt'; | |
43 | ||
44 | # Generate README | |
45 | print "readme_from $in_file to $format\n"; | |
46 | if ($format =~ m/te?xt/) { | |
47 | $out_file = $self->_readme_txt($in_file, $out_file, $options); | |
48 | } elsif ($format =~ m/html?/) { | |
49 | $out_file = $self->_readme_htm($in_file, $out_file, $options); | |
50 | } elsif ($format eq 'man') { | |
51 | $out_file = $self->_readme_man($in_file, $out_file, $options); | |
52 | } elsif ($format eq 'pdf') { | |
53 | $out_file = $self->_readme_pdf($in_file, $out_file, $options); | |
54 | } | |
55 | ||
26 | 56 | if ($clean) { |
27 | $self->clean_files('README'); | |
57 | $self->clean_files($out_file); | |
28 | 58 | } |
59 | ||
29 | 60 | return 1; |
30 | 61 | } |
62 | ||
63 | ||
64 | sub _readme_txt { | |
65 | my ($self, $in_file, $out_file, $options) = @_; | |
66 | $out_file ||= 'README'; | |
67 | require Pod::Text; | |
68 | my $parser = Pod::Text->new( @$options ); | |
69 | open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n"; | |
70 | $parser->output_fh( *$out_fh ); | |
71 | $parser->parse_file( $in_file ); | |
72 | close $out_fh; | |
73 | return $out_file; | |
74 | } | |
75 | ||
76 | ||
77 | sub _readme_htm { | |
78 | my ($self, $in_file, $out_file, $options) = @_; | |
79 | $out_file ||= 'README.htm'; | |
80 | require Pod::Html; | |
81 | Pod::Html::pod2html( | |
82 | "--infile=$in_file", | |
83 | "--outfile=$out_file", | |
84 | @$options, | |
85 | ); | |
86 | # Remove temporary files if needed | |
87 | for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') { | |
88 | if (-e $file) { | |
89 | unlink $file or warn "Warning: Could not remove file '$file'.\n$!\n"; | |
90 | } | |
91 | } | |
92 | return $out_file; | |
93 | } | |
94 | ||
95 | ||
96 | sub _readme_man { | |
97 | my ($self, $in_file, $out_file, $options) = @_; | |
98 | $out_file ||= 'README.1'; | |
99 | require Pod::Man; | |
100 | my $parser = Pod::Man->new( @$options ); | |
101 | $parser->parse_from_file($in_file, $out_file); | |
102 | return $out_file; | |
103 | } | |
104 | ||
105 | ||
106 | sub _readme_pdf { | |
107 | my ($self, $in_file, $out_file, $options) = @_; | |
108 | $out_file ||= 'README.pdf'; | |
109 | eval { require App::pod2pdf; } | |
110 | or die "Could not generate $out_file because pod2pdf could not be found\n"; | |
111 | my $parser = App::pod2pdf->new( @$options ); | |
112 | $parser->parse_from_file($in_file); | |
113 | open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n"; | |
114 | select $out_fh; | |
115 | $parser->output; | |
116 | select STDOUT; | |
117 | close $out_fh; | |
118 | return $out_file; | |
119 | } | |
120 | ||
31 | 121 | |
32 | 122 | sub _all_from { |
33 | 123 | my $self = shift; |
43 | 133 | |
44 | 134 | __END__ |
45 | 135 | |
46 | #line 112 | |
136 | #line 254 | |
47 | 137 |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.00'; | |
8 | $VERSION = '1.06'; | |
9 | 9 | @ISA = 'Module::Install::Base'; |
10 | 10 | $ISCORE = 1; |
11 | 11 | } |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.00'; | |
8 | $VERSION = '1.06'; | |
9 | 9 | @ISA = 'Module::Install::Base'; |
10 | 10 | $ISCORE = 1; |
11 | 11 | } |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.00'; | |
8 | $VERSION = '1.06'; | |
9 | 9 | @ISA = qw{Module::Install::Base}; |
10 | 10 | $ISCORE = 1; |
11 | 11 | } |
30 | 30 | # This is not enforced yet, but will be some time in the next few |
31 | 31 | # releases once we can make sure it won't clash with custom |
32 | 32 | # Module::Install extensions. |
33 | $VERSION = '1.00'; | |
33 | $VERSION = '1.06'; | |
34 | 34 | |
35 | 35 | # Storage for the pseudo-singleton |
36 | 36 | $MAIN = undef; |
450 | 450 | } |
451 | 451 | |
452 | 452 | sub _cmp ($$) { |
453 | _version($_[0]) <=> _version($_[1]); | |
453 | _version($_[1]) <=> _version($_[2]); | |
454 | 454 | } |
455 | 455 | |
456 | 456 | # Cloned from Params::Util::_CLASS |
466 | 466 | |
467 | 467 | 1; |
468 | 468 | |
469 | # Copyright 2008 - 2010 Adam Kennedy. | |
469 | # Copyright 2008 - 2012 Adam Kennedy. |
0 | 0 | package Module::Signature; |
1 | $Module::Signature::VERSION = '0.68'; | |
1 | $Module::Signature::VERSION = '0.73'; | |
2 | 2 | |
3 | 3 | use 5.005; |
4 | 4 | use strict; |
17 | 17 | |
18 | 18 | use ExtUtils::Manifest (); |
19 | 19 | use Exporter; |
20 | use File::Spec; | |
20 | 21 | |
21 | 22 | @EXPORT_OK = ( |
22 | 23 | qw(sign verify), |
142 | 143 | } |
143 | 144 | |
144 | 145 | sub _has_gpg { |
145 | `gpg --version` =~ /GnuPG.*?(\S+)\s*$/m or return; | |
146 | my $gpg = _which_gpg() or return; | |
147 | `$gpg --version` =~ /GnuPG.*?(\S+)\s*$/m or return; | |
146 | 148 | return $1; |
147 | 149 | } |
148 | 150 | |
212 | 214 | or /~$/ or /\.old$/ or /\#$/ or /^\.#/; |
213 | 215 | } |
214 | 216 | |
217 | my $which_gpg; | |
218 | sub _which_gpg { | |
219 | # Cache it so we don't need to keep checking. | |
220 | return $which_gpg if $which_gpg; | |
221 | ||
222 | for my $gpg_bin ('gpg', 'gpg2', 'gnupg', 'gnupg2') { | |
223 | my $version = `$gpg_bin --version 2>&1`; | |
224 | if( $version && $version =~ /GnuPG/ ) { | |
225 | $which_gpg = $gpg_bin; | |
226 | return $which_gpg; | |
227 | } | |
228 | } | |
229 | } | |
230 | ||
215 | 231 | sub _verify_gpg { |
216 | 232 | my ($sigtext, $plaintext, $version) = @_; |
217 | 233 | |
220 | 236 | |
221 | 237 | my $keyserver = _keyserver($version); |
222 | 238 | |
239 | my $gpg = _which_gpg(); | |
223 | 240 | my @quiet = $Verbose ? () : qw(-q --logger-fd=1); |
224 | 241 | my @cmd = ( |
225 | qw(gpg --verify --batch --no-tty), @quiet, ($KeyServer ? ( | |
242 | $gpg, qw(--verify --batch --no-tty), @quiet, ($KeyServer ? ( | |
226 | 243 | "--keyserver=$keyserver", |
227 | 244 | ($AutoKeyRetrieve and $version ge '1.0.7') |
228 | 245 | ? '--keyserver-options=auto-key-retrieve' |
379 | 396 | die "Could not write to $sigfile" |
380 | 397 | if -e $sigfile and (-d $sigfile or not -w $sigfile); |
381 | 398 | |
399 | my $gpg = _which_gpg(); | |
400 | ||
382 | 401 | local *D; |
383 | open D, "| gpg --clearsign >> $sigfile.tmp" or die "Could not call gpg: $!"; | |
402 | open D, "| $gpg --clearsign >> $sigfile.tmp" or die "Could not call $gpg: $!"; | |
384 | 403 | print D $plaintext; |
385 | 404 | close D; |
386 | 405 | |
409 | 428 | # This doesn't work because the output from verify goes to STDERR. |
410 | 429 | # If I try to redirect it using "--logger-fd 1" it just hangs. |
411 | 430 | # WTF? |
412 | my @verify = `gpg --batch --verify $SIGNATURE`; | |
431 | my @verify = `$gpg --batch --verify $SIGNATURE`; | |
413 | 432 | while (@verify) { |
414 | 433 | if (/key ID ([0-9A-F]+)$/) { |
415 | 434 | $key_id = $1; |
422 | 441 | my $found_key; |
423 | 442 | if (defined $key_id && defined $key_name) { |
424 | 443 | my $keyserver = _keyserver($version); |
425 | while (`gpg --batch --keyserver=$keyserver --search-keys '$key_name'`) { | |
444 | while (`$gpg --batch --keyserver=$keyserver --search-keys '$key_name'`) { | |
426 | 445 | if (/^\(\d+\)/) { |
427 | 446 | $found_name = 0; |
428 | 447 | } elsif ($found_name) { |
513 | 532 | |
514 | 533 | sub _digest_object { |
515 | 534 | my($algorithm) = @_; |
535 | ||
536 | # Avoid loading Digest::* from relative paths in @INC. | |
537 | local @INC = grep { File::Spec->file_name_is_absolute($_) } @INC; | |
538 | ||
539 | # Constrain algorithm name to be of form ABC123. | |
540 | my ($base, $variant) = ($algorithm =~ /^([_a-zA-Z]+)([0-9]+)$/g) | |
541 | or die "Malformed algorithm name: $algorithm (should match /\\w+\\d+/)"; | |
542 | ||
516 | 543 | my $obj = eval { Digest->new($algorithm) } || eval { |
517 | my ($base, $variant) = ($algorithm =~ /^(\w+?)(\d+)$/g) or die; | |
518 | 544 | require "Digest/$base.pm"; "Digest::$base"->new($variant) |
519 | 545 | } || eval { |
520 | 546 | require "Digest/$algorithm.pm"; "Digest::$algorithm"->new |
521 | 547 | } || eval { |
522 | my ($base, $variant) = ($algorithm =~ /^(\w+?)(\d+)$/g) or die; | |
523 | 548 | require "Digest/$base/PurePerl.pm"; "Digest::$base\::PurePerl"->new($variant) |
524 | 549 | } || eval { |
525 | 550 | require "Digest/$algorithm/PurePerl.pm"; "Digest::$algorithm\::PurePerl"->new |
526 | 551 | } or do { eval { |
527 | my ($base, $variant) = ($algorithm =~ /^(\w+?)(\d+)$/g) or die; | |
528 | 552 | warn "Unknown cipher: $algorithm, please install Digest::$base, Digest::$base$variant, or Digest::$base\::PurePerl\n"; |
529 | 553 | } and return } or do { |
530 | 554 | warn "Unknown cipher: $algorithm, please install Digest::$algorithm\n"; return; |
917 | 941 | |
918 | 942 | L<Module::Install>, L<ExtUtils::MakeMaker>, L<Module::Build> |
919 | 943 | |
944 | L<Dist::Zilla::Plugin::Signature> | |
945 | ||
920 | 946 | =head1 AUTHORS |
921 | 947 | |
922 | 948 | 唐鳳 E<lt>cpan@audreyt.orgE<gt> |