summaryrefslogtreecommitdiffstats
path: root/bin/metas/perl.d
diff options
context:
space:
mode:
Diffstat (limited to 'bin/metas/perl.d')
-rwxr-xr-xbin/metas/perl.d/perl-dist26
1 files changed, 15 insertions, 11 deletions
diff --git a/bin/metas/perl.d/perl-dist b/bin/metas/perl.d/perl-dist
index ef08d0a..57b468b 100755
--- a/bin/metas/perl.d/perl-dist
+++ b/bin/metas/perl.d/perl-dist
@@ -130,19 +130,24 @@ sub _mergedups
return;
}
-#---HELPER FUNCTION---
-sub _yankcheckers
+sub _filterdeps(&$)
{
- my ($deps_ref) = @_;
- my %checkdeps;
+ my ($fsub, $deps) = @_;
+ my %fed;
- my @pkgs = keys %$deps_ref;
- for my $testdep (grep { /^perl-pod-coverage$|perl-test-/ } @pkgs){
- my $val = delete($deps_ref->{$testdep});
- $checkdeps{$testdep} = $val if(defined($val));
+ my @pkgs = keys(%$deps);
+ for my $dname (grep { $fsub->() } @pkgs){
+ my $dver = delete($deps->{$dname});
+ $fed{$dname} = $dver if(defined $dver);
}
- return \%checkdeps;
+ return \%fed;
+}
+
+#---HELPER FUNCTION---
+sub _yankcheckers
+{
+ _filterdeps { /^perl-pod-coverage$|^perl-test-/ } $_[0]
}
#---HELPER FUNCTION---
@@ -223,8 +228,7 @@ sub prereqs
# have this separated. Force any test modules to be checkdepends.
if(!$pkgdeps{'checkdepends'} && $pkgname !~ /\Aperl-test-/) {
my $checkdeps = {};
- my $makedeps = $pkgdeps{'makedepends'};
- _merge($checkdeps, _yankcheckers($makedeps));
+ _merge($checkdeps, _yankcheckers($pkgdeps{$_})) for(qw/makedepends depends/);
$pkgdeps{'checkdepends'} = $checkdeps;
}