App-PDRUtils

 view release on metacpan or  search on metacpan

lib/App/PDRUtils/DistIniCmd/add_prereq.pm  view on Meta::CPAN

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
my $rel   = $args{rel} // 'requires';
 
if (App::PDRUtils::Cmd::_has_prereq($iod, $mod)) {
    return [304, "Already has prereq to '$mod'"];
}
 
my $section;
for my $s ($iod->list_sections) {
    next unless $s =~ m!\Aprereqs(?:\s*/\s*(\w+))?\z!ix;
    if ($phase eq 'runtime' && $rel eq 'requires') {
        next unless !$1 || lc($1) eq 'runtimerequires';
    } else {
        next unless  $1 && lc($1) eq $phase.$rel;
    }
    $section = $s;
    last;
}
unless ($section) {
    if ($phase eq 'runtime' && $rel eq 'requires') {
        $section = 'Prereqs';
    } else {



( run in 0.863 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )