Permalink
Browse files

Merge pull request #81 from bernd/master

Add deb Pre-Depends support
  • Loading branch information...
2 parents c71a414 + 6b5cdf0 commit 08146b2e95857b1f0c69264d0e17f9be6116d90d @jordansissel committed Aug 20, 2011
Showing with 12 additions and 0 deletions.
  1. +8 −0 lib/fpm/target/deb.rb
  2. +4 −0 templates/deb.erb
View
8 lib/fpm/target/deb.rb
@@ -13,6 +13,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
@@ -150,4 +154,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
View
4 templates/deb.erb
@@ -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 -%>

0 comments on commit 08146b2

Please sign in to comment.