From cbfad9f5ca99a7c596c302c8d872fdeb7d30c221 Mon Sep 17 00:00:00 2001 From: zyppe <210hcl@gmail.com> Date: Mon, 5 Aug 2024 14:07:09 +0800 Subject: [PATCH] Add URL fix for SUSE's spec and add test --- lib/Parse/RPM/Spec.pm | 2 +- t/parse-rpm-spec.t | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index ced7681..eb871c8 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -42,7 +42,7 @@ sub _build_parse_spec { summary => qr[^Summary:\s+(.+)], license => qr[^License:\s+(.+)], group => qr[^Group:\s+(\S+)], - url => qr[^(URL|Url):\s+(\S+)], + url => qr[^(?:URL|Url):\s+(\S+)], buildroot => qr[^BuildRoot:\s+(\S+)], buildarch => qr[^BuildArch:\s+(\S+)], excludearch => qr[^ExcludeArch:\s+(\S+)], diff --git a/t/parse-rpm-spec.t b/t/parse-rpm-spec.t index 33321ac..d8a1b31 100644 --- a/t/parse-rpm-spec.t +++ b/t/parse-rpm-spec.t @@ -12,6 +12,7 @@ isa_ok($spec, 'Parse::RPM::Spec'); is($spec->name, 'perl-Array-Compare', 'Correct name'); is($spec->summary, 'Perl extension for comparing arrays', 'Correct summary'); +is($spec->url, 'http://search.cpan.org/dist/Array-Compare/', 'Correct URL'); is($spec->epoch, 1, 'Correct epoch'); is($spec->version, '1.16', 'Correct version');