Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

dpkg vs rubygem version dependency #269

Merged
merged 1 commit into from

2 participants

@radim

Hi,

I would like to verify what's causing the following issue between gem -> deb dependencies. Using FPM to convert all necessary Chef gems into Debian packages. Chef gem itself depends on net-ssh-multi ~> 1.1.0, but net-ssh-multi gem turns as debian package version 1.1.

This causes issue where dpkg >= 1.1.0 dependency can't be satisfied by rubygem-net-ssh-multi-1.1 package.

Is this dpkg issue or is the better way to enforce Rubygems version to always include build number, i.e 1.1 -> 1.1.0 (so far using this fix as temporary workaround).

Thanks

Radim

@radim

My fix to get it working is

radim/fpm@d846983

@jordansissel
Owner

I don't know what you mean when you say 'net-ssh-multi turns into version 1.1 - here's what I see:

% ruby bin/fpm -s gem -t deb -v 1.1.0 net-ssh-multi
Successfully installed net-ssh-multi-1.1
1 gem installed
Created deb package {"path":"rubygem-net-ssh-multi_1.1.0_all.deb"}

# See what the package version is
% ar p rubygem-net-ssh-multi_1.1.0_all.deb control.tar.gz | tar -zx ./control 
% grep Version ./control
Version: 1.1.0
@jordansissel
Owner

oooh I see now! The net-ssh-multi has an actual release versioned literally as "1.1" (http://rubygems.org/gems/net-ssh-multi/versions/1.1)

I think your patch is probably a decent solution to this.

@jordansissel
Owner

Want to send a pull request for your patch? Can you also include in the code a comment above your patch that explains the purpose of it - that way it's easier to later :)

@jordansissel jordansissel merged commit 34dbd7f into jordansissel:master
@jordansissel

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. @radim

    Expand gem version

    radim authored
This page is out of date. Refresh to see the latest.
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"
Something went wrong with that request. Please try again.