Permalink
Browse files

Expand gem version

  • Loading branch information...
1 parent 7bf937b commit 3aecbad5023491e870477362d537eddb5e69e279 @radim radim committed Oct 1, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 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 3aecbad

Please sign in to comment.