From 939e064b5f4b1224099d27acc0afe6c0adbb87db Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Wed, 4 Nov 2020 07:51:04 +0000 Subject: [PATCH 01/19] Add Test::Exception to prereqs. Bump version --- Build.PL | 1 + Changes | 7 ++++++- lib/Parse/RPM/Spec.pm | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Build.PL b/Build.PL index d70315e..ba29675 100644 --- a/Build.PL +++ b/Build.PL @@ -11,6 +11,7 @@ my $build = Module::Build->new( }, build_requires => { 'Test::More' => 0, + 'Test::Exception' => 0, }, build_recommends => { 'Test::Pod' => 0, diff --git a/Changes b/Changes index cf33472..af2422a 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,9 @@ -2020-11-3 Dave Cross +2020-11-04 Dave Cross + + * Version 1.0.2 + * Add Test::Exception to prereqs + +2020-11-03 Dave Cross * Version 1.0.1 * Improved tests diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index a0a5d17..7c5b3a9 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -7,7 +7,7 @@ use warnings; use Carp; use Moose; -our $VERSION = 'v1.0.1'; +our $VERSION = 'v1.0.2'; has file => ( is => 'ro', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); From 674c06c6e8de3a0187f9fb6b5952d9843c101964 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 5 Nov 2020 17:02:11 +0000 Subject: [PATCH 02/19] Added Github workflow --- .github/workflows/perltest.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/perltest.yml diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml new file mode 100644 index 0000000..58fd9d1 --- /dev/null +++ b/.github/workflows/perltest.yml @@ -0,0 +1,31 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + perl: [ 'latest' ] + name: Perl ${{ matrix.perl }} on ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Set up perl + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: ${{ matrix.perl }} + - run: perl -V + - run: cpanm --installdeps . + - run: prove -lv t From ef2401b09206fc110945c4a2be6a8f3f4f405393 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Mon, 9 Nov 2020 12:05:48 +0000 Subject: [PATCH 03/19] Stop testing on Windows --- .github/workflows/perltest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml index 58fd9d1..9b2c868 100644 --- a/.github/workflows/perltest.yml +++ b/.github/workflows/perltest.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + os: [ 'ubuntu-latest', 'macos-latest' ] perl: [ 'latest' ] name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: From 43d0bfc5d8acb82a5df7a59152d163c52e71cddd Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Sat, 23 Jan 2021 11:47:17 +0000 Subject: [PATCH 04/19] Add bugtracker to metadata. Prep for release --- Build.PL | 3 +++ Changes | 5 +++++ lib/Parse/RPM/Spec.pm | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Build.PL b/Build.PL index ba29675..487bf06 100644 --- a/Build.PL +++ b/Build.PL @@ -26,6 +26,9 @@ my $build = Module::Build->new( url => 'git://github.com/davorg/parse-rpm-spec.git', web => 'https://github.com/davorg/parse-rpm-spec', }, + bugtracker => { + web => 'https://github.com/davorg/parse-rpm-spec/issues', + }, }, }, ); diff --git a/Changes b/Changes index af2422a..d566588 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +2021-01-23 Dave Cross + + * Version 1.0.3 + * Add bugtracker to metadata + 2020-11-04 Dave Cross * Version 1.0.2 diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 7c5b3a9..961219f 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -7,7 +7,7 @@ use warnings; use Carp; use Moose; -our $VERSION = 'v1.0.2'; +our $VERSION = 'v1.0.3'; has file => ( is => 'ro', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); From 780b0b886ff041c48e2463b02cdb2500202c73bd Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Sat, 23 Jan 2021 12:12:20 +0000 Subject: [PATCH 05/19] Act on some Kritika feedback --- lib/Parse/RPM/Spec.pm | 2 +- t/parse-rpm-spec.t | 5 ++++- t/pod.t | 3 +++ t/pod_coverage.t | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 961219f..c1f2cbb 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -83,7 +83,7 @@ sub parse_file { croak "Spec file $file is empty\n"; } - open my $fh, $file or croak "Cannot open $file: $!\n"; + open my $fh, '<', $file or croak "Cannot open $file: $!\n"; my $scalars = $self->parse_spec->{scalars}; my $arrays = $self->parse_spec->{arrays}; diff --git a/t/parse-rpm-spec.t b/t/parse-rpm-spec.t index c776e09..b5f8fb8 100644 --- a/t/parse-rpm-spec.t +++ b/t/parse-rpm-spec.t @@ -1,9 +1,12 @@ +use strict; +use warnings; + use Test::More; use Test::Exception; BEGIN { use_ok('Parse::RPM::Spec') }; -ok($spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ), +ok(my $spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ), 'Got an object'); isa_ok($spec, 'Parse::RPM::Spec'); diff --git a/t/pod.t b/t/pod.t index 437887a..d6e05a9 100644 --- a/t/pod.t +++ b/t/pod.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; diff --git a/t/pod_coverage.t b/t/pod_coverage.t index d692068..a2cc35f 100644 --- a/t/pod_coverage.t +++ b/t/pod_coverage.t @@ -1,3 +1,6 @@ +use strict; +use warnings; + use Test::More; eval "use Test::Pod::Coverage 1.00"; plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@; From 99838215e024601bda7f7d954633405c49354290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20H=C3=A6gland?= Date: Fri, 25 Mar 2022 20:33:20 +0100 Subject: [PATCH 06/19] Remove .travis.yml travis-ci.org has shut down. We can use GitHub actions for continuous integration as a replacement. --- .travis.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b749796..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: perl -matrix: - include: - - perl: "5.30" - - perl: "5.28" - - perl: "5.26" - - perl: "5.24" - - perl: "5.22" - - perl: "5.20" - dist: trusty - - perl: "5.18" - dist: trusty - - perl: "5.16" - dist: trusty - - perl: "5.14" - dist: trusty - - perl: "5.12" - dist: trusty - - perl: "5.10" - dist: trusty - -before_install: - cpanm -n Devel::Cover::Report::Coveralls -script: - perl Build.PL && ./Build build && cover -test -report coveralls From 5bfd739b70fc2c9f4726a22ec0e4af1faf6c248d Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 12 Jan 2023 18:01:03 +0000 Subject: [PATCH 07/19] Version 1.1.0 --- .github/workflows/perltest.yml | 2 +- Changes | 4 ++++ lib/Parse/RPM/Spec.pm | 8 +++++++- t/file.spec | 1 + t/parse-rpm-spec.t | 4 +++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml index 9b2c868..57fcbfc 100644 --- a/.github/workflows/perltest.yml +++ b/.github/workflows/perltest.yml @@ -21,7 +21,7 @@ jobs: perl: [ 'latest' ] name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up perl uses: shogo82148/actions-setup-perl@v1 with: diff --git a/Changes b/Changes index d566588..8b647f5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +2022-12-09 Dave Cross + + * Support ExcludeArch, ExclusiveArch, ExcluseOS, ExclusiveOS + 2021-01-23 Dave Cross * Version 1.0.3 diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index c1f2cbb..30fda27 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -7,7 +7,7 @@ use warnings; use Carp; use Moose; -our $VERSION = 'v1.0.3'; +our $VERSION = 'v1.1.0'; has file => ( is => 'ro', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); @@ -23,6 +23,8 @@ has buildroot => ( is => 'rw', isa => 'Str' ); has buildarch => ( is => 'rw', isa => 'Str' ); has buildrequires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } ); has requires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } ); +has [ qw( excluderach exclusivearch excludeos exclusiveos ) ] + => ( is => 'rw', isa => 'Str' ); has parse_spec => ( is => 'ro', @@ -43,6 +45,10 @@ sub _build_parse_spec { url => qr[^URL:\s*(\S+)], buildroot => qr[^BuildRoot:\s*(\S+)], buildarch => qr[^BuildArch:\s*(\S+)], + excludearch => qr[^ExcludeArch:\s*(\S+)], + exclusivearch => qr[^ExclusiveArch:\s*(\S+)], + excludeos => qr[^ExcludeOS:\s*(\S+)], + exclusiveos => qr[^ExclusiveOS:\s*(\S+)], }, arrays => { source => qr[^Source\d*:\s*(\S+)], diff --git a/t/file.spec b/t/file.spec index c2956d6..844028f 100644 --- a/t/file.spec +++ b/t/file.spec @@ -12,6 +12,7 @@ BuildArch: noarch BuildRequires: perl >= 1:5.6.0 BuildRequires: perl(Module::Build) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +ExclusiveArch: megaCPU %description If you have two arrays and you want to know if they are the same or diff --git a/t/parse-rpm-spec.t b/t/parse-rpm-spec.t index b5f8fb8..84376c4 100644 --- a/t/parse-rpm-spec.t +++ b/t/parse-rpm-spec.t @@ -17,11 +17,13 @@ is($spec->epoch, 1, 'Correct epoch'); is($spec->version, '1.16', 'Correct version'); $spec->version('1.17'); is($spec->version, '1.17', 'Changed version correctly'); -is($spec->buildarch, 'noarch', 'Correct build arrchitecture'); +is($spec->buildarch, 'noarch', 'Correct build architecture'); is(@{$spec->buildrequires}, 2, 'Correct number of build requirements'); is($spec->buildrequires->[0], 'perl >= 1:5.6.0', 'First build requirement is correct'); +is($spec->exclusivearch, 'megaCPU', 'Correct exclusive architecture'); + dies_ok { Parse::RPM::Spec->new } 'No spec file given'; dies_ok { Parse::RPM::Spec->new( file => 'not-there') } From 529c06b04c1ca5b8858bbe609d3f8605b29f2651 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 12 Jan 2023 18:06:01 +0000 Subject: [PATCH 08/19] Failing test for license-parsing --- t/parse-license-correctly.t | 13 ++++ t/perl-License-Syntax.spec | 131 ++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 t/parse-license-correctly.t create mode 100644 t/perl-License-Syntax.spec diff --git a/t/parse-license-correctly.t b/t/parse-license-correctly.t new file mode 100644 index 0000000..266cfce --- /dev/null +++ b/t/parse-license-correctly.t @@ -0,0 +1,13 @@ +use strict; +use warnings; + +use Test::More; +use Test::Exception; + +BEGIN { use_ok('Parse::RPM::Spec') }; + +my $spec = Parse::RPM::Spec->new( { file => 't/perl-License-Syntax.spec' } ); + +is($spec->license, 'GPL-1.0-or-later OR Artistic-1.0-Perl', 'Correct license'); + +done_testing; diff --git a/t/perl-License-Syntax.spec b/t/perl-License-Syntax.spec new file mode 100644 index 0000000..22ded0d --- /dev/null +++ b/t/perl-License-Syntax.spec @@ -0,0 +1,131 @@ +Name: perl-License-Syntax +Version: 0.13 +Release: 23%{?dist} +Summary: Coding and decoding of license strings using SPDX and SUSE syntax +License: GPL-1.0-or-later OR Artistic-1.0-Perl +URL: https://metacpan.org/release/License-Syntax +Source0: https://cpan.metacpan.org/authors/id/J/JN/JNW/License-Syntax-%{version}.tar.gz +BuildArch: noarch +# Build +BuildRequires: coreutils +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 +BuildRequires: perl(strict) +BuildRequires: perl(warnings) +# Runtime +BuildRequires: perl(Carp) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(DBD::SQLite) +BuildRequires: perl(DBI) +BuildRequires: perl(POSIX) +BuildRequires: perl(Text::CSV) +# Tests only +BuildRequires: perl(Test::More) +# Optional tests only +BuildRequires: perl(Pod::Coverage) >= 0.18 +BuildRequires: perl(Test::Pod) >= 1.22 +BuildRequires: perl(Test::Pod::Coverage) >= 1.08 +Requires: perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo $version)) +Requires: perl(DBD::SQLite) + +%description +License::Syntax is an object oriented module. When constructing new +License::Syntax objects, you can provide a mapping table for license +names. The table is used for recognizing alternate alias names for the +licenses (left hand side) and also defines the canonical short names of +the licenses (right hand side). The mapping table is consulted twice, +before and after decoding the syntax, thus non-terminal mappings may +actually be followed. + +%prep +%setup -q -n License-Syntax-%{version} +chmod -c a-x license_syntax.pl + +%build +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 +%{make_build} + +%install +%{make_install} +rm -f %{buildroot}/%{perl_vendorlib}/License/license_syntax.pl +%{_fixperms} %{buildroot}/* + +%check +make test + +%files +%doc Changes README license_syntax.pl synopsis.csv +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Fri Jul 22 2022 Fedora Release Engineering - 0.13-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue May 31 2022 Jitka Plesnikova - 0.13-22 +- Perl 5.36 rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 0.13-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 0.13-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri May 21 2021 Jitka Plesnikova - 0.13-19 +- Perl 5.34 rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 0.13-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 0.13-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jun 23 2020 Jitka Plesnikova - 0.13-16 +- Perl 5.32 rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 0.13-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 0.13-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 31 2019 Jitka Plesnikova - 0.13-13 +- Perl 5.30 rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 0.13-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 0.13-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Jun 28 2018 Jitka Plesnikova - 0.13-10 +- Perl 5.28 rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 0.13-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.13-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jun 05 2017 Jitka Plesnikova - 0.13-7 +- Perl 5.26 rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 0.13-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sun May 15 2016 Jitka Plesnikova - 0.13-5 +- Perl 5.24 rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 0.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 0.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Jun 05 2015 Jitka Plesnikova - 0.13-2 +- Perl 5.22 rebuild + +* Thu Apr 02 2015 Petr Šabata 0.13-1 +- Initial packaging From f7c21bdcba09ca19a94358c4bbb77378e7064ef2 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 12 Jan 2023 18:09:03 +0000 Subject: [PATCH 09/19] Fix failing test --- lib/Parse/RPM/Spec.pm | 34 +++++++++++++++++----------------- t/parse-license-correctly.t | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 30fda27..b15923c 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -35,25 +35,25 @@ has parse_spec => ( sub _build_parse_spec { return { scalars => { - name => qr[^Name:\s*(\S+)], - version => qr[^Version:\s*(\S+)], - epoch => qr[^Epoch:\s*(\S+)], - release => qr[^Release:\s*(\S+)], - summary => qr[^Summary:\s*(.+)], - license => qr[^License:\s*(.+)], - group => qr[^Group:\s*(\S+)], - url => qr[^URL:\s*(\S+)], - buildroot => qr[^BuildRoot:\s*(\S+)], - buildarch => qr[^BuildArch:\s*(\S+)], - excludearch => qr[^ExcludeArch:\s*(\S+)], - exclusivearch => qr[^ExclusiveArch:\s*(\S+)], - excludeos => qr[^ExcludeOS:\s*(\S+)], - exclusiveos => qr[^ExclusiveOS:\s*(\S+)], + name => qr[^Name:\s+(\S+)], + version => qr[^Version:\s+(\S+)], + epoch => qr[^Epoch:\s+(\S+)], + release => qr[^Release:\s+(\S+)], + summary => qr[^Summary:\s+(.+)], + license => qr[^License:\s+(.+)], + group => qr[^Group:\s+(\S+)], + url => qr[^URL:\s+(\S+)], + buildroot => qr[^BuildRoot:\s+(\S+)], + buildarch => qr[^BuildArch:\s+(\S+)], + excludearch => qr[^ExcludeArch:\s+(\S+)], + exclusivearch => qr[^ExclusiveArch:\s+(\S+)], + excludeos => qr[^ExcludeOS:\s+(\S+)], + exclusiveos => qr[^ExclusiveOS:\s+(\S+)], }, arrays => { - source => qr[^Source\d*:\s*(\S+)], - buildrequires => qr[^BuildRequires:\s*(.+)], - requires => qr[^Requires:\s*(.+)], + source => qr[^Source\d*:\s+(\S+)], + buildrequires => qr[^BuildRequires:\s+(.+)], + requires => qr[^Requires:\s+(.+)], }, }; } diff --git a/t/parse-license-correctly.t b/t/parse-license-correctly.t index 266cfce..77f83f4 100644 --- a/t/parse-license-correctly.t +++ b/t/parse-license-correctly.t @@ -4,7 +4,7 @@ use warnings; use Test::More; use Test::Exception; -BEGIN { use_ok('Parse::RPM::Spec') }; +use Parse::RPM::Spec; my $spec = Parse::RPM::Spec->new( { file => 't/perl-License-Syntax.spec' } ); From b61e9b4921f813a84150f85b30040d511dde642a Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 12 Jan 2023 18:11:43 +0000 Subject: [PATCH 10/19] Prep for release --- Changes | 6 ++++++ lib/Parse/RPM/Spec.pm | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 8b647f5..9c90fe6 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ +2023-01-12 Dave Cross + + * Version 1.1.1 + * Fix problem parsing perl-License-Syntax.spec (thanks Michal Josef Špaček) + 2022-12-09 Dave Cross + * Version 1.1.0 * Support ExcludeArch, ExclusiveArch, ExcluseOS, ExclusiveOS 2021-01-23 Dave Cross diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index b15923c..2e8a6f6 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -7,7 +7,7 @@ use warnings; use Carp; use Moose; -our $VERSION = 'v1.1.0'; +our $VERSION = 'v1.1.1'; has file => ( is => 'ro', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); From e1dd92a4f9c249812b70ef2469442954567d7e5c Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Fri, 13 Jan 2023 10:40:00 +0000 Subject: [PATCH 11/19] Add failing test --- t/file.spec | 1 + t/parse-rpm-spec.t | 1 + 2 files changed, 2 insertions(+) diff --git a/t/file.spec b/t/file.spec index 844028f..b92537e 100644 --- a/t/file.spec +++ b/t/file.spec @@ -13,6 +13,7 @@ BuildRequires: perl >= 1:5.6.0 BuildRequires: perl(Module::Build) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) ExclusiveArch: megaCPU +ExcludeArch: crapOS %description If you have two arrays and you want to know if they are the same or diff --git a/t/parse-rpm-spec.t b/t/parse-rpm-spec.t index 84376c4..33321ac 100644 --- a/t/parse-rpm-spec.t +++ b/t/parse-rpm-spec.t @@ -23,6 +23,7 @@ is($spec->buildrequires->[0], 'perl >= 1:5.6.0', 'First build requirement is correct'); is($spec->exclusivearch, 'megaCPU', 'Correct exclusive architecture'); +is($spec->excludearch, 'crapCPU', 'Correct excluded architecture'); dies_ok { Parse::RPM::Spec->new } 'No spec file given'; From e229a81b61c7af579cc704fe97cbcde5b42248cd Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Fri, 13 Jan 2023 10:41:18 +0000 Subject: [PATCH 12/19] Make test pass --- lib/Parse/RPM/Spec.pm | 2 +- t/file.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 2e8a6f6..45dc02b 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -23,7 +23,7 @@ has buildroot => ( is => 'rw', isa => 'Str' ); has buildarch => ( is => 'rw', isa => 'Str' ); has buildrequires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } ); has requires => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { [] } ); -has [ qw( excluderach exclusivearch excludeos exclusiveos ) ] +has [ qw( excludearch exclusivearch excludeos exclusiveos ) ] => ( is => 'rw', isa => 'Str' ); has parse_spec => ( diff --git a/t/file.spec b/t/file.spec index b92537e..413f402 100644 --- a/t/file.spec +++ b/t/file.spec @@ -13,7 +13,7 @@ BuildRequires: perl >= 1:5.6.0 BuildRequires: perl(Module::Build) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) ExclusiveArch: megaCPU -ExcludeArch: crapOS +ExcludeArch: crapCPU %description If you have two arrays and you want to know if they are the same or From dd6cfc1536c4772986dd1608c7afb7eed78ffb2b Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Fri, 13 Jan 2023 10:50:48 +0000 Subject: [PATCH 13/19] Prep for release --- Changes | 5 +++++ lib/Parse/RPM/Spec.pm | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 9c90fe6..4adc8fb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +2023-01-13 Dave Cross + + * Version 1.1.2 + * Fix name of excludearch method (thanks Michal Josef Špaček) + 2023-01-12 Dave Cross * Version 1.1.1 diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 45dc02b..7ff132a 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -7,7 +7,7 @@ use warnings; use Carp; use Moose; -our $VERSION = 'v1.1.1'; +our $VERSION = 'v1.1.2'; has file => ( is => 'ro', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); From dc1eda7b6765c648e4649845dd0d4ef7cc141c94 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Thu, 16 Feb 2023 09:37:10 +0000 Subject: [PATCH 14/19] Add dependabot.yml --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..dfd0e30 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Set update schedule for GitHub Actions + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" From 1a27e209a080fb965fcdc1a7bb64c8fbdd470cc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 00:33:48 +0000 Subject: [PATCH 15/19] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/perltest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml index 57fcbfc..110a6c3 100644 --- a/.github/workflows/perltest.yml +++ b/.github/workflows/perltest.yml @@ -21,7 +21,7 @@ jobs: perl: [ 'latest' ] name: Perl ${{ matrix.perl }} on ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up perl uses: shogo82148/actions-setup-perl@v1 with: From 9e62d29643988e6b1565e3b711731b4e85027cfd Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Mon, 22 Jan 2024 20:31:28 +0000 Subject: [PATCH 16/19] Standardise CPAN Actions --- .github/workflows/perltest.yml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/perltest.yml b/.github/workflows/perltest.yml index 110a6c3..0f185c4 100644 --- a/.github/workflows/perltest.yml +++ b/.github/workflows/perltest.yml @@ -1,9 +1,5 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: push: branches: [ master ] @@ -11,21 +7,15 @@ on: branches: [ master ] workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ 'ubuntu-latest', 'macos-latest' ] - perl: [ 'latest' ] - name: Perl ${{ matrix.perl }} on ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Set up perl - uses: shogo82148/actions-setup-perl@v1 - with: - perl-version: ${{ matrix.perl }} - - run: perl -V - - run: cpanm --installdeps . - - run: prove -lv t + uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-test.yml@main + + coverage: + uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-coverage.yml@main + + perlcritic: + uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-perlcritic.yml@main + + complexity: + uses: PerlToolsTeam/github_workflows/.github/workflows/cpan-complexity.yml@main From ae8b3ac2f8e9525fb4c7f40b82b94928b6c81194 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Tue, 23 Jan 2024 13:23:26 +0000 Subject: [PATCH 17/19] Fix GitHub URLs --- Build.PL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Build.PL b/Build.PL index 487bf06..f4f7477 100644 --- a/Build.PL +++ b/Build.PL @@ -23,11 +23,11 @@ my $build = Module::Build->new( resources => { repository => { type => 'git', - url => 'git://github.com/davorg/parse-rpm-spec.git', - web => 'https://github.com/davorg/parse-rpm-spec', + url => 'git://github.com/davorg-cpan/parse-rpm-spec.git', + web => 'https://github.com/davorg-cpan/parse-rpm-spec', }, bugtracker => { - web => 'https://github.com/davorg/parse-rpm-spec/issues', + web => 'https://github.com/davorg-cpan/parse-rpm-spec/issues', }, }, }, From e491d549e785fa2494479c8c99930d8a7d2a3566 Mon Sep 17 00:00:00 2001 From: zyppe <210hcl@gmail.com> Date: Mon, 5 Aug 2024 13:12:19 +0800 Subject: [PATCH 18/19] Fix Url for SUSE's spec --- lib/Parse/RPM/Spec.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index 7ff132a..ced7681 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:\s+(\S+)], + url => qr[^(URL|Url):\s+(\S+)], buildroot => qr[^BuildRoot:\s+(\S+)], buildarch => qr[^BuildArch:\s+(\S+)], excludearch => qr[^ExcludeArch:\s+(\S+)], 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 19/19] 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');