Browse files

Remove dashes from the version in rpm targets

RPMs do not allow dashes in the main part of the version string.

We need to test @version because some sources (I am looking at you gem)
set version to a Fixnum, and others to a String.
  • Loading branch information...
1 parent 068f7cd commit dccf79e7f4df9fa099470c8dc8aa4f4fed99b18b @tabletcorry tabletcorry committed Aug 23, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/fpm/target/rpm.rb
@@ -28,6 +28,16 @@ def url
+ def version
+ if @version.kind_of?(String) and @version.include?("-")
+"Package version '#{@version}' includes dashes, converting" \
+ " to underscores")
+ @version = @version.gsub(/-/, "_")
+ end
+ return @version
+ end
def build!(params)
raise "No package name given. Can't assemble package" if !@name
# TODO(sissel): Abort if 'rpmbuild' tool not found.

0 comments on commit dccf79e

Please sign in to comment.