Skip to content

Commit

Permalink
Add support for deb Pre-Depends.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed Jul 26, 2011
1 parent 66624eb commit 6b5cdf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/fpm/target/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def self.flags(opts, settings)
"For = dependencies, allow iterations on the specified version. Default is to be specific.") do |x|
settings.target[:ignore_iteration] = true
end

opts.on("--pre-depends DEPENDENCY", "Add DEPENDENCY as Pre-Depends.") do |dep|
(settings.target[:pre_depends] ||= []) << dep
end
end

def needs_md5sums
Expand Down Expand Up @@ -149,4 +153,8 @@ def fix_dependency(dep)
return dep
end
end # def fix_dependency

def pre_dependencies
self.settings[:pre_depends] || []
end # def pre_dependencies
end # class FPM::Target::Deb
4 changes: 4 additions & 0 deletions templates/deb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Maintainer: <%= maintainer or "<unknown>" %>
<% properdeps = dependencies.collect { |d| fix_dependency(d) }.flatten -%>
Depends: <%= properdeps.flatten.join(", ") %>
<% end -%>
<% if !pre_dependencies.empty? -%>
<% properpredeps = pre_dependencies.collect { |d| fix_dependency(d) }.flatten -%>
Pre-Depends: <%= properpredeps.flatten.join(", ") %>
<% end -%>
<% if !conflicts.empty? -%>
Conflicts: <%= conflicts.join(", ") %>
<% end -%>
Expand Down

0 comments on commit 6b5cdf0

Please sign in to comment.