Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding feature: --no-depends flag for deb and rpm #289

Merged
merged 2 commits into from

2 participants

@dnbert

This commit introduces a new CLI option of "--no-depends". The --no-depends option allows users to request that no dependency be added to their Spec or Control files.

Here is the result of the rspec:

bundle exec rspec
Skipping RPM#output tests because 'rpmbuild' isn't in your PATH {"level":"warn"}
.....Successfully installed example-1.0
1 gem installed
.Successfully installed example-1.0
1 gem installed
.Successfully installed example-1.0
1 gem installed
............................running install
running build
running install_egg_info
Creating /tmp/package-python-staging20121114-19003-cq5oea/usr/local/lib/python2.6/dist-packages/
Writing /tmp/package-python-staging20121114-19003-cq5oea/usr/local/lib/python2.6/dist-packages/example-1.0.egg-info
.running install
running build
running install_egg_info
Creating /tmp/package-python-staging20121114-19003-ofcd6b/usr/local/lib/python2.6/dist-packages/
Writing /tmp/package-python-staging20121114-19003-ofcd6b/usr/local/lib/python2.6/dist-packages/example-1.0.egg-info
.running install
running build
running install_egg_info
Creating /tmp/package-python-staging20121114-19003-1hl0zty/usr/local/lib/python2.6/dist-packages/
Writing /tmp/package-python-staging20121114-19003-1hl0zty/usr/local/lib/python2.6/dist-packages/example-1.0.egg-info
..........................

Finished in 2.98 seconds
63 examples, 0 failures

templates/rpm.erb
@@ -43,9 +43,11 @@ Vendor: <%= vendor %>
URL: <%= url or "http://nourlgiven.example.com/" %>
Packager: <%= maintainer %>
+<% if !attributes[:no_depends] -%>
@jordansissel Owner

shouldn't this be :no_depends? like the deb.erb patch?

@dnbert
dnbert added a note

Yes you are correct, I've updated that line to use the appropriate attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jordansissel jordansissel merged commit 02e0868 into jordansissel:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2012
  1. @dnbert
Commits on Nov 15, 2012
  1. @dnbert
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +3 −0  lib/fpm/command.rb
  2. +1 −1  templates/deb.erb
  3. +2 −0  templates/rpm.erb
View
3  lib/fpm/command.rb
@@ -62,6 +62,9 @@ class FPM::Command < Clamp::Command
@dependencies << val
end # -d / --depends
+ option "--no-depends", :flag, "Do not list any dependencies in this package",
+ :default => false
+
option "--provides", "PROVIDES",
"What this package provides (usually a name). This flag can be "\
"specified multiple times." do |val|
View
2  templates/deb.erb
@@ -5,7 +5,7 @@ Vendor: <%= vendor %>
Architecture: <%= architecture %>
Maintainer: <%= maintainer %>
Installed-Size: <%= attributes[:deb_installed_size] %>
-<% if !dependencies.empty? -%>
+<% if !dependencies.empty? and !attributes[:no_depends?] -%>
Depends: <%= dependencies.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if !conflicts.empty? -%>
View
2  templates/rpm.erb
@@ -43,9 +43,11 @@ Vendor: <%= vendor %>
URL: <%= url or "http://nourlgiven.example.com/" %>
Packager: <%= maintainer %>
+<% if !attributes[:no_depends?] -%>
<% dependencies.each do |req| -%>
Requires: <%= req %>
<% end -%>
+<% end -%>
<% provides.each do |prov| -%>
Provides: <%= prov %>
<% end -%>
Something went wrong with that request. Please try again.