Permalink
Browse files

Fixed gem ~> version operator translated to rpm require.

In gem specs ~> is a Pessimistic Version Consrtaint that is inclusive
on the bottom end. E.g., '~> 2.2' means '>= 2.2.0 and < 3.0'.

I changed the translation to RPM spec to be >= and <. It was > and <.

http://docs.rubygems.org/read/chapter/16
http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-advanced-packaging.html
  • Loading branch information...
1 parent 67b4cd5 commit 171ad0045d5de70c05f02a30c15c508ee561833a @antoncohen antoncohen committed Apr 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/fpm/package/rpm.rb
View
@@ -91,7 +91,7 @@ def converted_from(origin)
name, op, version = dep.split(/\s+/)
if op == "~>"
# ~> x.y means: > x.y and < (x+1).0
- fixed_deps << "#{name} > #{version}"
+ fixed_deps << "#{name} >= #{version}"
fixed_deps << "#{name} < #{version.to_i + 1}.0.0"
else
fixed_deps << dep

0 comments on commit 171ad00

Please sign in to comment.