Skip to content

Commit

Permalink
fix small problem in the debian output
Browse files Browse the repository at this point in the history
the created deb was issuing obsolete operators for the package
dependencies. This commit replaces the < and > operators by << and >>,
which are recommeded by debian policy
  • Loading branch information
zllak committed Aug 17, 2012
1 parent 2c20228 commit 4f85cf0
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 4f85cf0

Please sign in to comment.