diff options
author | Justin Davis <jrcd83@gmail.com> | 2011-08-16 16:36:58 +0200 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2011-08-16 16:36:58 +0200 |
commit | c68390210ea387e042e409df5f6547cf832f6d4d (patch) | |
tree | 34457759b626f746b32ec3240645f3eb949e4519 /bin/macros | |
parent | c0dbbe214291b9f64515d6fa78cae994e35d00c5 (diff) | |
download | genpkg-c68390210ea387e042e409df5f6547cf832f6d4d.tar.gz genpkg-c68390210ea387e042e409df5f6547cf832f6d4d.tar.xz |
Fix _mergedups. Fix typo of {'testing'}{'requires'}. Avoid empty deps.
Diffstat (limited to 'bin/macros')
-rwxr-xr-x | bin/macros/perl-dist | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/macros/perl-dist b/bin/macros/perl-dist index dc62ec8..7f74461 100755 --- a/bin/macros/perl-dist +++ b/bin/macros/perl-dist @@ -95,7 +95,7 @@ sub _mergedups my ($left, $right) = @_; for my $name (keys %$left) { - my $rver = $right->{$name} or next; + my $rver = delete $right->{$name} or next; my $lver = $left->{$name}; my $lvo = ($lver ? version->parse($lver) : 0); my $rvo = ($rver ? version->parse($rver) : 0); @@ -208,21 +208,23 @@ sub prereqs # maps perl names for different dependencies to ArchLinux's names my %namemap = ('configure' => 'makedepends', 'build' => 'makedepends', - 'testing' => 'checkdepends', + 'test' => 'checkdepends', 'runtime' => 'depends'); my %pkgdeps; while (my ($perl, $arch) = each %namemap) { - $pkgdeps{$arch} ||= {}; my $reqs = $prereqs->{$perl}{'requires'}; my $deps = _reqs2deps($reqs) if $reqs; - _merge($pkgdeps{$arch}, $deps) if $deps; + + next unless keys %$deps; + if ($pkgdeps{$arch}) { _merge($pkgdeps{$arch}, $deps); } + else { $pkgdeps{$arch} = $deps; } } # ArchLinux now has a separate array for dependencies that we only # need for checking (aka "testing"). Older perl METAs do not # have this separated. Force any test modules to be checkdepends. - if (!$pkgdeps{'checkdepends'} && $pkgname !~ /\Aperl-test-/) { + if (! $pkgdeps{'checkdepends'} && $pkgname !~ /\Aperl-test-/) { my $checkdeps; my $makedeps = $pkgdeps{'makedepends'}; _merge($checkdeps, _yankcheckers($makedeps)); |