Skip to content
Browse files

Merge pull request #269 from radim/master

dpkg vs rubygem version dependency
  • Loading branch information...
2 parents 8796a08 + 3aecbad commit 34dbd7fb8daa7d951fec5e9c577353c056413503 @jordansissel committed Oct 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/fpm/package/gem.rb
View
8 lib/fpm/package/gem.rb
@@ -112,7 +112,13 @@ def load_package_info(gem_path)
#self.name = [attributes[:gem_package_name_prefix], spec.name].join("-")
self.license = (spec.license or "no license listed in #{File.basename(file)}")
- self.version = spec.version.to_s
+
+ # expand spec's version to match RationalVersioningPolicy to prevent cases
+ # where missing 'build' number prevents correct dependency resolution by target
+ # package manager. Ie. for dpkg 1.1 != 1.1.0
+ m = spec.version.to_s.match /^(\d)?.?(\d+)?.?(\d+)?/
+ self.version = m.captures.map {|m| m ? m : 0}.join('.')
+
self.vendor = spec.author
self.url = spec.homepage
self.category = "Languages/Development/Ruby"

0 comments on commit 34dbd7f

Please sign in to comment.
Something went wrong with that request. Please try again.