Skip to content

Commit

Permalink
Merge pull request #250 from zllak/fix/deb
Browse files Browse the repository at this point in the history
fix small problem in the debian output
  • Loading branch information
jordansissel committed Aug 24, 2012
2 parents 8707c52 + 4f85cf0 commit aea625c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/fpm/package/deb.rb
Expand Up @@ -270,6 +270,12 @@ def converted_from(origin)
end.flatten
end # def converted_from

def debianize_op(op)
# Operators in debian packaging are <<, <=, =, >= and >>
# So any operator like < or > must be replaced
{:< => "<<", :> => ">>"}[op.to_sym] or op
end

def fix_dependency(dep)
# Deb dependencies are: NAME (OP VERSION), like "zsh (> 3.0)"
# Convert anything that looks like 'NAME OP VERSION' to this format.
Expand All @@ -280,7 +286,7 @@ def fix_dependency(dep)
name, op, version = dep.split(/ +/)
if !version.nil?
# Convert strings 'foo >= bar' to 'foo (>= bar)'
dep = "#{name} (#{op} #{version})"
dep = "#{name} (#{debianize_op(op)} #{version})"
end
end

Expand Down

0 comments on commit aea625c

Please sign in to comment.