Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit dccf79e7f4df9fa099470c8dc8aa4f4fed99b18b 1 parent 068f7cd
@tabletcorry tabletcorry authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/fpm/target/rpm.rb
View
10 lib/fpm/target/rpm.rb
@@ -28,6 +28,16 @@ def url
end
end
+ def version
+ if @version.kind_of?(String) and @version.include?("-")
+ @logger.info("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.
Please sign in to comment.
Something went wrong with that request. Please try again.