Skip to content

Commit

Permalink
Merge pull request jordansissel#343 from barn/epoch_of_zero
Browse files Browse the repository at this point in the history
Make RPM cope with an input epoch of zero.
  • Loading branch information
jordansissel committed Jan 24, 2013
2 parents 75c2e6f + a076aeb commit b8141d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/fpm/package/rpm.rb
Expand Up @@ -271,6 +271,7 @@ def build_sub_dir
# with fpm 0.4.3 and older)
def epoch
return 1 if @epoch.nil?
return @epoch if @epoch.is_a?(Numeric)
return nil if @epoch.empty?
return @epoch
end # def epoch
Expand Down
5 changes: 5 additions & 0 deletions spec/fpm/package/rpm_spec.rb
Expand Up @@ -42,6 +42,10 @@
it "should default to 1" do
insist { subject.epoch.to_s } == "1"
end
it "should cope with it being zero" do
subject.epoch = 0
insist { subject.epoch.to_s } == "0"
end
end

describe "#to_s" do
Expand All @@ -57,6 +61,7 @@
end
end


describe "#templating" do
context "default user and group" do
before :all do
Expand Down

0 comments on commit b8141d4

Please sign in to comment.