rpm/perlprov-package.diff
Dominique Leuenberger 10c11e4e5d Accepting request 503703 from home:kraih
The package "perl-Task-Kensho-ModuleDev" is currently not installable because there's a dependency on "perl(Dist::Zilla)" that can't be resolved. The reason is that the module Dist::Zilla uses a new way to declare its version as part of the package name "package Dist::Zilla 6.009;", and that the perl.prov script can't understand yet.

This patch adds support for that and a few more new package statement variations.

OBS-URL: https://build.opensuse.org/request/show/503703
OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=394
2017-06-14 14:12:41 +00:00

27 lines
1018 B
Diff

Support package statements like "package 1.2.3;" and "package 1.2.3 {", which are
new in Perl 5.12 and 5.14
--- ./scripts/perl.prov.orig 2017-06-09 15:20:11.869617486 +0200
+++ ./scripts/perl.prov 2017-06-09 15:04:59.840952250 +0200
@@ -129,9 +129,9 @@
# package name so we report all namespaces except some common
# false positives as if they were provided packages (really ugly).
- if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
+ if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*(?:v?([0-9_.]+)\s*)?[;{]/) {
$package = $1;
- undef $version;
+ $version = $2;
if ($package eq 'main') {
undef $package;
} else {
@@ -139,7 +139,7 @@
# the package definition is broken up over multiple blocks.
# In that case, don't stomp a previous $VERSION we might have
# found. (See BZ#214496.)
- $require{$package} = undef unless (exists $require{$package});
+ $require{$package} = $version unless (exists $require{$package});
}
}