| 1 | # | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # This file is part of Dist-Zilla-Plugin-Git | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # This software is copyright (c) 2009 by Jerome Quelin. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||||||||||||||||
| 9 | # this section comes from Makefile.git.PL and is inserted into Makefile.PL | ||||||||||||||||||||||||||||||||||||||||||
| 10 | # Git 1.5.4 introduced the --exclude-standard option to git ls-files, | ||||||||||||||||||||||||||||||||||||||||||
| 11 | # which Git::Check needs to work properly. | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use version; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | my $need_version = version->parse('1.5.4'); | |||||||||||||||||||||||||||||||||||||||||
| 14 | eval { | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | my $git_version = `git --version` or die "Unable to execute git\n"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | $git_version =~ /git \s+ version \s* ( \d+ (?: \.\d+ )+ )( [-.]rc\d+)?/x | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | or die "Unable to determine git version\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | my $rc = $2 || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$2 || ''
MC/DC0%0/1
$2 || ''
$2
Truth table50%1/2
A
A= $2
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | $git_version = version->parse("$1"); | |||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | die "git $need_version or later required, you have $git_version$rc\n" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$git_version < $need_version or $git_version == $need_version and $rc
$git_version == $need_version and $rc
MC/DC0%0/3
$git_version < $need_version or $git_version == $need_version and $rc
$git_version < $need_version
$git_version == $need_version
$rc
Truth table25%1/4
A or B and C
A= $git_version < $need_versionB= $git_version == $need_versionC= $rc
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | if $git_version < $need_version or $git_version == $need_version and $rc; | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | } or do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | print $@; | |||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if (parse_args()->{FORCE_INSTALL}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | print "FORCE_INSTALL specified, attempting to install anyway.\n"; | |||||||||||||||||||||||||||||||||||||||||
| 29 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | print <<"END MESSAGE"; | |||||||||||||||||||||||||||||||||||||||||
| 31 | \nDist::Zilla::Plugin::Git requires git $need_version or later in your PATH, | ||||||||||||||||||||||||||||||||||||||||||
| 32 | and it wasn't found. If you want to install anyway, run | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | PERL_MM_OPT=FORCE_INSTALL $^X Makefile.PL | ||||||||||||||||||||||||||||||||||||||||||
| 35 | END MESSAGE | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | exit 0; # Indicate missing non-Perl prerequisite | |||||||||||||||||||||||||||||||||||||||||
| 38 | } # end else not FORCE_INSTALL | ||||||||||||||||||||||||||||||||||||||||||
| 39 | }; # end do when Git prerequisite is not met | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub parse_args { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_args: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | require ExtUtils::MakeMaker; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | require Text::ParseWords; | |||||||||||||||||||||||||||||||||||||||||
| 44 | ExtUtils::MakeMaker::parse_args( | ||||||||||||||||||||||||||||||||||||||||||
| 45 | my $tmp = {}, | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$ENV{'PERL_MM_OPT'} || ''
MC/DC0%0/1
$ENV{'PERL_MM_OPT'} || ''
$ENV{'PERL_MM_OPT'}
Truth table0%0/2
A
A= $ENV{'PERL_MM_OPT'}
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | @ARGV, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | return $tmp->{ARGS} || {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$tmp->{'ARGS'} || {}
MC/DC0%0/1
$tmp->{'ARGS'} || {}
$tmp->{'ARGS'}
Truth table0%0/2
A
A= $tmp->{'ARGS'}
| |||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||