Version 0.04.
Handle BuildArch definition. Thanks to Steve Goldner for pointing out the omission.
This commit is contained in:
parent
29340d719a
commit
2f20b0d347
2 changed files with 4 additions and 2 deletions
|
@ -7,7 +7,7 @@ use warnings;
|
||||||
use Carp;
|
use Carp;
|
||||||
use Moose;
|
use Moose;
|
||||||
|
|
||||||
our $VERSION = '0.03';
|
our $VERSION = '0.04';
|
||||||
|
|
||||||
has file => ( is => 'rw', isa => 'Str', required => 1 );
|
has file => ( is => 'rw', isa => 'Str', required => 1 );
|
||||||
has name => ( is => 'rw', isa => 'Str' );
|
has name => ( is => 'rw', isa => 'Str' );
|
||||||
|
@ -66,6 +66,7 @@ sub parse_file {
|
||||||
/^URL:\s*(\S+)/ and $self->{url} = $1;
|
/^URL:\s*(\S+)/ and $self->{url} = $1;
|
||||||
/^Source0?:\s*(\S+)/ and $self->{source} = $1;
|
/^Source0?:\s*(\S+)/ and $self->{source} = $1;
|
||||||
/^BuildRoot:\s*(\S+)/ and $self->{buildroot} = $1;
|
/^BuildRoot:\s*(\S+)/ and $self->{buildroot} = $1;
|
||||||
|
/^BuildArch:\s*(\S+)/ and $self->{buildarch} = $1;
|
||||||
|
|
||||||
/^BuildRequires:\s*(.+)/ and push @{$self->{buildrequires}}, $1;
|
/^BuildRequires:\s*(.+)/ and push @{$self->{buildrequires}}, $1;
|
||||||
/^Requires:\s*(.+)/ and push @{$self->{requires}}, $1;
|
/^Requires:\s*(.+)/ and push @{$self->{requires}}, $1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use Test::More tests => 10;
|
use Test::More tests => 11;
|
||||||
BEGIN { use_ok('Parse::RPM::Spec') };
|
BEGIN { use_ok('Parse::RPM::Spec') };
|
||||||
|
|
||||||
ok($spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ));
|
ok($spec = Parse::RPM::Spec->new( { file => 't/file.spec' } ));
|
||||||
|
@ -11,5 +11,6 @@ is($spec->name, 'perl-Array-Compare');
|
||||||
is($spec->version, '1.16');
|
is($spec->version, '1.16');
|
||||||
$spec->version('1.17');
|
$spec->version('1.17');
|
||||||
is($spec->version, '1.17');
|
is($spec->version, '1.17');
|
||||||
|
is($spec->buildarch, 'noarch');
|
||||||
is(@{$spec->buildrequires}, 2);
|
is(@{$spec->buildrequires}, 2);
|
||||||
is($spec->buildrequires->[0], 'perl >= 1:5.6.0');
|
is($spec->buildrequires->[0], 'perl >= 1:5.6.0');
|
||||||
|
|
Loading…
Add table
Reference in a new issue