New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --gem-disable-dependencies flag to allow for excluding one or more dependencies #598

Merged
merged 1 commit into from Apr 23, 2014

Conversation

Projects
None yet
2 participants
@someword
Contributor

someword commented Dec 12, 2013

I've run into situations where i'm building rpm's of gem's to install into an embedded ruby instance (for example sensu). The embedded ruby may already include one or more gem's that are dependencies of the gem i'm installing. So in this situation I would like to be able to pass in '--gem-disable-dependencies <gem_name>' and have the specified gem removed from the auto dependency list.

@@ -147,6 +150,10 @@ def load_package_info(gem_path)
# Some reqs can be ">= a, < b" versions, let's handle that.
reqs.to_s.split(/, */).each do |req|
if attributes[:disable_dependencies]

This comment has been minimized.

@jordansissel

jordansissel Jan 10, 2014

Owner

this should be attributes[:gem_disable_dependencies]

This comment has been minimized.

@someword

someword Jan 13, 2014

Contributor

Jordan.
I had set the attribute name (:attribute_name => :disable_dependencies) in the option. Because this is a multi value option I don't ever see attributes[:gem_disable_dependencies] as being available. When I dump the attributes themselves I see this ':gem_disable_dependencies=>nil'. I do see attributes[:gem_disable_dependencies_list] as getting set though (:gem_disable_dependencies_list=>["clamp", "cabin"]). Would you prefer I refer the attribute name as what I think is the default is
'attributes[:gem_disable_dependencies_list]' and not override the attribute name in the option.

or

set the attribute name in the option via
:attribute_name => :gem_disable_dependencies

Or some other course of action.
Thanks. Derek.

This comment has been minimized.

@jordansissel

jordansissel Jan 13, 2014

Owner

Ahh yeah sorry, I think it's ok to override the attribute name if it makes it more readable.

For examples, several existing flags on fpm use multivalue and override the attribute name (like the -d flag is :dependencies)

This comment has been minimized.

@someword

someword Jan 13, 2014

Contributor

Jordan.
So i changed my patch/rebased and repushed to my repo. From what I can tell the existing pull request now points to my current patch someword@a437506 ?
Do you need anything else from me?
Thanks.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Jan 10, 2014

For posterity, can you show me an example of what you'd like to disable?

@someword

This comment has been minimized.

Contributor

someword commented Jan 10, 2014

Jordan.
Here is an example of me building some rpm's from gem's. I am installing
the rpm/gem into a ruby location which already has the correct event
machine and http_parser gem installed which came as part of the ruby
version. While I'm certain that what led me into this situation needs to
be revisited I felt that others might make the same bad decision:)

find . -name '*.gem' | xargs -rn1 /tmp/gems/bin/fpm -d
sensugem-http_parser.rb -d libxslt -d sensu -s gem -t rpm

--gem-bin-path /opt/sensu/embedded/usr/bin --gem-gem
/opt/sensu/embedded/bin/gem
--gem-package-name-prefix sensugem

--gem-disable-dependencies http_parser.rb --gem-disable-dependencies
eventmachine

Does that help?

On Fri, Jan 10, 2014 at 3:07 PM, Jordan Sissel notifications@github.comwrote:

For posterity, can you show me an example of what you'd like to disable?


Reply to this email directly or view it on GitHubhttps://github.com//pull/598#issuecomment-32076099
.

jordansissel added a commit that referenced this pull request Apr 23, 2014

Merge pull request #598 from someword/master
Add --gem-disable-dependencies flag to allow for excluding one or more dependencies

@jordansissel jordansissel merged commit 22b4b52 into jordansissel:master Apr 23, 2014

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 23, 2014

I'm going to rename this flag to --gem-disable-dependency because it seems more clear that you're telling it one dependency to remove for each instance of the flag. When plural dependencies it reads to me as though you're saying "disable all dependencies" which isn't what you mean, right?

Open to discussion :)

jordansissel added a commit that referenced this pull request Apr 23, 2014

@someword

This comment has been minimized.

Contributor

someword commented Apr 23, 2014

rename sounds good to me.
thanks

On Apr 22, 2014, at 18:17, Jordan Sissel notifications@github.com wrote:

I'm going to rename this flag to --gem-disable-dependency because it seems more clear that you're telling it one dependency to remove for each instance of the flag. When plural dependencies it reads to me as though you're saying "disable all dependencies" which isn't what you mean, right?

Open to discussion :)


Reply to this email directly or view it on GitHub.

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014

jls
Merge pull request jordansissel#598 from someword/master
Add --gem-disable-dependencies flag to allow for excluding one or more dependencies

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014

Merge pull request jordansissel#598 from someword/master
Add --gem-disable-dependencies flag to allow for excluding one or more dependencies

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014

jordansissel added a commit that referenced this pull request Apr 24, 2015

Merge pull request #598 from someword/master
Add --gem-disable-dependencies flag to allow for excluding one or more dependencies

jordansissel added a commit that referenced this pull request Apr 24, 2015

jordansissel added a commit that referenced this pull request Jun 20, 2016

Merge pull request #598 from someword/master
Add --gem-disable-dependencies flag to allow for excluding one or more dependencies

jordansissel added a commit that referenced this pull request Jun 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment