diff --git a/lib/Parse/RPM/Spec.pm b/lib/Parse/RPM/Spec.pm index a002ea7..3224daf 100644 --- a/lib/Parse/RPM/Spec.pm +++ b/lib/Parse/RPM/Spec.pm @@ -12,6 +12,7 @@ our $VERSION = '0.05'; has file => ( is => 'rw', isa => 'Str', required => 1 ); has name => ( is => 'rw', isa => 'Str' ); has version => ( is => 'rw', isa => 'Str' ); +has epoch => ( is => 'rw', isa => 'Str' ); has release => ( is => 'rw', isa => 'Str' ); has summary => ( is => 'rw', isa => 'Str' ); has license => ( is => 'rw', isa => 'Str' ); @@ -59,6 +60,7 @@ sub parse_file { while (<$fh>) { /^Name:\s*(\S+)/ and $self->{name} = $1; /^Version:\s*(\S+)/ and $self->{version} = $1; + /^Epoch:\s*(\S+)/ and $self->{epoch} = $1; /^Release:\s*(\S+)/ and $self->{release} = $1; /^Summary:\s*(.+)/ and $self->{summary} = $1; /^License:\s*(.+)/ and $self->{license} = $1; diff --git a/t/file.spec b/t/file.spec index 0987611..c2956d6 100644 --- a/t/file.spec +++ b/t/file.spec @@ -1,5 +1,6 @@ Name: perl-Array-Compare Version: 1.16 +Epoch: 1 Release: 1%{?dist} Summary: Perl extension for comparing arrays License: GPL+ or Artistic diff --git a/t/parse-rpm-spec.t b/t/parse-rpm-spec.t index 9352b35..47c2a26 100644 --- a/t/parse-rpm-spec.t +++ b/t/parse-rpm-spec.t @@ -1,4 +1,4 @@ -use Test::More tests => 10; +use Test::More tests => 11; BEGIN { use_ok('Parse::RPM::Spec') }; ok($spec = Parse::RPM::Spec->new( { file => 't/file.spec' } )); @@ -6,6 +6,7 @@ isa_ok($spec, 'Parse::RPM::Spec'); is($spec->name, 'perl-Array-Compare'); is($spec->summary, 'Perl extension for comparing arrays'); +is($spec->epoch, 1); is($spec->version, '1.16'); $spec->version('1.17');