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

Make the --exclude argument work by removing the excluded paths from the staging directory #186

Merged
merged 2 commits into from Mar 30, 2012

Conversation

Projects
None yet
4 participants
@cpennington
Contributor

cpennington commented Mar 26, 2012

No description provided.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 27, 2012

Thanks for the patch!

I'll have a ponder about how the api change (Adding #exclude to Package) since I'm not totally sold on that - perhaps there's a better way? This way feels weird. Still, I want to get this functioning again, so even if I can't come up with something that feels a bit smoother I'll merge this as-is, since it looks ok :)

@vStone

This comment has been minimized.

Contributor

vStone commented Mar 27, 2012

I've been testing this patch since I really need to the exclude functionality but I cant seem to get it working

running

fpm -n blah -s dir -t rpm --prefix "/etc/" --exclude '*/.git*' blah

still adds .git folder/files.

Also tested: --exclude ".gitignore" and --exlude "*/.gitignore"

@vStone

This comment has been minimized.

Contributor

vStone commented Mar 27, 2012

Also, fpm fails if you don't use --exclude

@bernd

This comment has been minimized.

Contributor

bernd commented Mar 27, 2012

I was thinking about adding the exclude cleanup of the staging area to Package#convert to avoid adding another method to the Package API. But then we still have to pass the list of excluded files to the package somehow.

@cpennington

This comment has been minimized.

Contributor

cpennington commented Mar 27, 2012

The interface that I've been using for exclude is that of Dir.glob, rooted in the prefixed directory. So, to ignore .git, you'd just use --exclude=.git (I don't know if this is a change from the previous implementation)

As for adding exclude cleanup into package#convert, that should work fine. The exclude paths are already added as an attribute to the package (along with all of the other commandline arguments).

fpm failing w/o exclude is no good. I'll fix that up asap.

@cpennington

This comment has been minimized.

Contributor

cpennington commented Mar 27, 2012

Actually, while I'm at it, I'll see if I can remove the additional api bit, and roll it into convert.

input.dependencies += dependencies
input.provides += provides
input.replaces += replaces
input.conflicts += @conflicts

This comment has been minimized.

@jordansissel

jordansissel Mar 30, 2012

Owner

why use the instance variables here? These are available as methods (created by the options like --conflicts)

This comment has been minimized.

@jordansissel

jordansissel Mar 30, 2012

Owner

I'll merge this pull, but will be reverting the this particular change (ivars instead of methods). Unless I'm missing something, let me know why this change was made, curious! :)

This comment has been minimized.

@cpennington

cpennington Mar 30, 2012

Contributor

I had issues when trying to use excludes in the same way as conflicts/dependencies/provides/replaces. It may have just been an oversight of mine, honestly, as I'm relatively inexperienced w/ ruby.

This comment has been minimized.

@jordansissel

jordansissel Mar 30, 2012

Owner

For being inexperienced with ruby, this patch was super awesome. Good work! :)

@jordansissel jordansissel merged commit 0f2da16 into jordansissel:master Mar 30, 2012

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 30, 2012

Thanks for this :)

jordansissel added a commit that referenced this pull request Mar 30, 2012

- Make file exclusion work again. Fixes #185
  This improves on the patch in #186.
- Add tests to make sure exclude stays working :)

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

jls
- Make file exclusion work again. Fixes jordansissel#185
  This improves on the patch in jordansissel#186.
- Add tests to make sure exclude stays working :)

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

- Make file exclusion work again. Fixes jordansissel#185
  This improves on the patch in jordansissel#186.
- Add tests to make sure exclude stays working :)

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

- Make file exclusion work again. Fixes #185
  This improves on the patch in #186.
- Add tests to make sure exclude stays working :)

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

- Make file exclusion work again. Fixes #185
  This improves on the patch in #186.
- Add tests to make sure exclude stays working :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment