Permalink
Browse files

Merge pull request #388 from r4um/fix_381

Closes #381 rpm, epoch should not be set by default.
  • Loading branch information...
jordansissel committed Mar 22, 2013
2 parents 3cd6715 + d9783e6 commit bc2f4155daf9a20c0374683b8aefe1d022f9bba2
Showing with 11 additions and 8 deletions.
  1. +7 −4 lib/fpm/package/rpm.rb
  2. +4 −4 spec/fpm/package/rpm_spec.rb
View
@@ -284,12 +284,15 @@ def build_sub_dir
#return File.join("BUILD", prefix)
end # def prefix
- # The default epoch value must be 1 (backward compatibility for rpms built
- # with fpm 0.4.3 and older)
+ # The default epoch value must be nil, see #381
def epoch
- return 1 if @epoch.nil?
return @epoch if @epoch.is_a?(Numeric)
- return nil if @epoch.empty?
+
+ if @epoch.nil? or @epoch.empty?
+ @logger.warn("no value for epoch is set, defaulting to nil")
+ return nil
+ end
+
return @epoch
end # def epoch
@@ -39,8 +39,8 @@
end
describe "#epoch" do
- it "should default to 1" do
- insist { subject.epoch.to_s } == "1"
+ it "should default to empty" do
+ insist { subject.epoch.to_s } == ""
end
it "should cope with it being zero" do
subject.epoch = 0
@@ -357,9 +357,9 @@ def subject.render_template; @rpmspec = template("rpm.erb").result(binding); end
rpmtags[tag.tag] = tag.value
end
- # Default epoch must be '1'
+ # Default epoch must be empty, see #381
# For some reason, epoch is an array of numbers in rpm?
- insist { rpmtags[:epoch] } == [1]
+ insist { rpmtags[:epoch] } == nil
# Default release must be '1'
insist { rpmtags[:release] } == "1"

0 comments on commit bc2f415

Please sign in to comment.