Imported Upstream version 0.50
gregor herrmann
10 years ago
0 | 0 | Revision history for Perl module Git::PurePerl: |
1 | ||
2 | 0.50 Sat Jan 25 14:58:16 CET 2014 | |
3 | - Now with the changes from 0.49 in CHANGES. That's it. | |
4 | ||
5 | 0.49 Sat Jan 25 14:55:42 CET 2014 | |
6 | - qw() in list context is an error now (gregor herrmann) | |
7 | - Fixed RT#90667 (Zoffix Znet) | |
1 | 8 | |
2 | 9 | 0.48 Thu Jul 14 22:53:55 BST 2011 |
3 | 10 | - Translation from Digest::SHA1 to Digest::SHA (Jonas Genannt) |
3 | 3 | - 'Leon Brocard <acme@astray.com>' |
4 | 4 | - 'Leon Brocard <acme@astray.com>' |
5 | 5 | build_requires: |
6 | ExtUtils::MakeMaker: 6.42 | |
6 | ExtUtils::MakeMaker: 6.36 | |
7 | 7 | Test::More: 0.88 |
8 | 8 | Test::utf8: 0.02 |
9 | 9 | configure_requires: |
10 | ExtUtils::MakeMaker: 6.42 | |
10 | ExtUtils::MakeMaker: 6.36 | |
11 | 11 | distribution_type: module |
12 | generated_by: 'Module::Install version 1.01' | |
12 | dynamic_config: 1 | |
13 | generated_by: 'Module::Install version 1.06' | |
13 | 14 | license: perl |
14 | 15 | meta-spec: |
15 | 16 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
35 | 36 | resources: |
36 | 37 | license: http://dev.perl.org/licenses/ |
37 | 38 | repository: git://github.com/bobtfish/git-pureperl.git |
38 | version: 0.48 | |
39 | version: 0.50 |
3 | 3 | use strict 'vars'; |
4 | 4 | use vars qw{$VERSION}; |
5 | 5 | BEGIN { |
6 | $VERSION = '1.01'; | |
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.01'; | |
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 |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.01'; | |
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.01'; | |
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.01'; | |
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 | } |
581 | 587 | sub requires_from { |
582 | 588 | my $self = shift; |
583 | 589 | my $content = Module::Install::_readperl($_[0]); |
584 | 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; | |
585 | 591 | while ( @requires ) { |
586 | 592 | my $module = shift @requires; |
587 | 593 | my $version = shift @requires; |
5 | 5 | |
6 | 6 | use vars qw{$VERSION @ISA $ISCORE}; |
7 | 7 | BEGIN { |
8 | $VERSION = '1.01'; | |
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.01'; | |
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.01'; | |
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 - 2011 Adam Kennedy. | |
469 | # Copyright 2008 - 2012 Adam Kennedy. |
3 | 3 | use Moose::Util::TypeConstraints; |
4 | 4 | use namespace::autoclean; |
5 | 5 | |
6 | enum 'ObjectKind' => qw(commit tree blob tag); | |
6 | enum 'ObjectKind' => [qw(commit tree blob tag)]; | |
7 | 7 | |
8 | 8 | has 'kind' => ( is => 'ro', isa => 'ObjectKind', required => 1 ); |
9 | 9 | has 'size' => ( is => 'ro', isa => 'Int', required => 0, lazy_build => 1 ); |
3 | 3 | use Moose::Util::TypeConstraints; |
4 | 4 | use namespace::autoclean; |
5 | 5 | |
6 | enum 'ObjectKind' => qw(commit tree blob tag); | |
6 | enum 'ObjectKind' => [qw(commit tree blob tag)]; | |
7 | 7 | |
8 | 8 | has 'kind' => ( is => 'ro', isa => 'ObjectKind', required => 1 ); |
9 | 9 | has 'size' => ( is => 'ro', isa => 'Int', required => 1 ); |
36 | 36 | use Path::Class; |
37 | 37 | use namespace::autoclean; |
38 | 38 | |
39 | our $VERSION = '0.48'; | |
39 | our $VERSION = '0.50'; | |
40 | 40 | $VERSION = eval $VERSION; |
41 | 41 | |
42 | 42 | has 'directory' => ( |
3 | 3 | use Test::More; |
4 | 4 | use Archive::Extract; |
5 | 5 | |
6 | foreach my $name qw(test-project test-project-packs test-project-packs2 test-encoding) { | |
6 | foreach my $name (qw(test-project test-project-packs test-project-packs2 test-encoding)) { | |
7 | 7 | next if -d $name; |
8 | 8 | my $ae = Archive::Extract->new( archive => "$name.tgz" ); |
9 | 9 | $ae->extract; |
6 | 6 | |
7 | 7 | my $checkout_directory = dir('t/checkout'); |
8 | 8 | |
9 | foreach my $directory qw(test-project test-project-packs test-project-packs2) | |
9 | foreach my $directory (qw(test-project test-project-packs test-project-packs2)) | |
10 | 10 | { |
11 | 11 | my $git = Git::PurePerl->new( directory => $directory ); |
12 | 12 | like( $git->master_sha1, qr/^[a-z0-9]{40}$/ ); |