-
Notifications
You must be signed in to change notification settings - Fork 32
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
Apply rules to implicitly created directories (Issue #85) #86
Apply rules to implicitly created directories (Issue #85) #86
Conversation
2a911b5
to
a7a69a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the review, I lost track of this PR.
I noticed a bunch of test failing, and for good reason. I think the basic idea is valid. However, that outcome is that also directories like /etc
get added. to my understanding that will let the RPM take ownership of the directory which might cause two issues:
- There could be a conflict when another file claims that directory
- The directory would get removed when the RPM is being uninstalled
The latter might be an issue in cases like /etc
.
I am also not quite sure that the idea of ignoring by prefix works as intended. Adding a prefix of /etc
would basically remove directories starting with /etc
.
I am not sure what a better approach would be. Maybe only adding directories up the path that was requested for scanning. Meaning: if you as the plugin to start scanning /foor/bar/baz
for adding to /usr/lib/app
, then just add directories automatically starting with /usr/lib/app
?
Another approach could be to add a prefix list explicitly enabling this feature for those prefixes.
Thank you for your feedback! I have thought about it a bit. I don't think there is a one-size-fits-all approach, which I tried to follow in my first implementation. That's why I've now chosen the approach where you explicitly specify a list of prefixes for which this feature is applied. I've also added an integration test for this new feature. |
I very much prefer this approach. I like the opt-in character of it. And I think it a reasonable concept to understand. Good idea! I am not so sure about the naming. Naming is hard I know :) … And am not trying to push back on the current naming, just checking if we could come up with something better. Basically it's a set of base directories we enable for automatic generation of intermediate directories, starting from the provided base, right? |
Yes, naming isn't so easy. I'm open for suggestions. ;)
Yes, you're right. While browsing through the source code and documentation, I came across the
If the flag is active, the intermediate folders are created explicitly (no problem with my approach). But if the flag is inactive, intermediate folders are still generated if the paths correspond to the base folders of my extension. |
Hm, … looks like I didn't work with that plugin for a while. So yes, that would be correct approach when "scanning"/"collecting". I am wondering if this now boils down to a documentation issue: If you scan, we have a flag for this. If you put files explicitly, you need to create directories yourself. I would somehow still feel your extension useful. But indeed maybe confusing. I am open for suggestions. |
I am wondering, what the improvement with this PR over the current situation? I am not trying to push back, but coming up with a good description of it. Like an example use case where things are much better now. |
Sorry for my late reply. Something came up after I pushed my commit. I had a bad feeling about overwriting the field Current behavior for following example:
Result with
Result with
I don't know a real use case for this situation. Perhaps my extension should override the behavior of the dictionary property in collection entry after all (behavior before last commit). I'm open for your suggestions. |
Thanks for the explanation. So I think it's better to keep this independent of the The The change you added would allow one to control the automatic generation of directories outside of the collector, right? I think that's a good feature. We just need to document that properly :) Otherwise it might get a bit confusing. And I think it might help having your example as part of this. I also think the naming is fine when it comes to that. I know you've done a lot already, and this drag on a bit. But I would hope that you could do a final thing, add some docs around here: rpm-builder/src/site/markdown/entry.md Lines 52 to 54 in 74ecb1a
Maybe create a small new sections about auto-creation of directories at the end of the file, but also mention the difference between both concepts in this location linked. It doesn't need to be much, just to explain the difference of both mechanisms. That would be awesome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good in any case. Maybe we can add some quick docs.
Thanks for your positive feedback! I'll try to contribute the requested improvements to the documentation on Monday. Perhaps I will come up with a better name for the configuration parameter by then.
Yes, that's correct. |
src/site/markdown/entry.md
Outdated
|
||
## Generate intermediate directories | ||
|
||
Since version `1.11.1 (TODO: enter correct version)` there is an option to automatically generate and add intermediate directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be the next minor version (major.minor.patch).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Thanks.
The next version would be 1.11.0
, if you could replace that, I'll merge and try to get it out today.
Thanks for your very fast response! I have changed the version strings in documentation to |
Bugfix to apply rules to implicitly created intermediate directories.
See issue #85 for details.