Skip to content
This repository

dpkg vs rubygem version dependency #269

merged 1 commit into from over 1 year ago

2 participants

Radim Marek Jordan Sissel
Radim Marek


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).



Radim Marek

My fix to get it working is


Jordan Sissel

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
Jordan Sissel

oooh I see now! The net-ssh-multi has an actual release versioned literally as "1.1" (

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

Jordan Sissel

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 :)

Jordan Sissel jordansissel merged commit 34dbd7f into from
Jordan Sissel

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 04, 2012
Radim Marek radim Expand gem version 3aecbad
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 lib/fpm/package/gem.rb
8 lib/fpm/package/gem.rb
@@ -112,7 +112,13 @@ def load_package_info(gem_path)
112 112
113 113 = [attributes[:gem_package_name_prefix],].join("-")
114 114 self.license = (spec.license or "no license listed in #{File.basename(file)}")
115   - self.version = spec.version.to_s
  115 +
  116 + # expand spec's version to match RationalVersioningPolicy to prevent cases
  117 + # where missing 'build' number prevents correct dependency resolution by target
  118 + # package manager. Ie. for dpkg 1.1 != 1.1.0
  119 + m = spec.version.to_s.match /^(\d)?.?(\d+)?.?(\d+)?/
  120 + self.version = {|m| m ? m : 0}.join('.')
  121 +
116 122 self.vendor =
117 123 self.url = spec.homepage
118 124 self.category = "Languages/Development/Ruby"

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.