-
Notifications
You must be signed in to change notification settings - Fork 127
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
How to modify rpm file listing to not manage all directories #59
Comments
Have you tried setting addParentDirs=false? On Wed, Oct 15, 2014 at 1:38 PM, Charles Walker [email protected]
|
yes, and at best i ended up with something like:
which upon removal of the rpm does not delete the |
So /opt/test is considered "built-in" then on your system. There was a recent enhancement just made to the underlying redline-rpm library that makes it safe to specify built-in directories on a per Contents basis: Not available as a feature within the ospackage-plugin yet, but should be straight-forward to add. Technically if you don't mind the "/opt/test" directory considered built-in for all rpm tasks within a build, you can call Contents.addBuiltinDirectory('/opt/test') currently in your build file during the configuration phase and it will do what you desire. Maybe I'll find time to start working on gradle-related things again and enhance the gradle-ospackage-plugin with this change, but I don't believe that's going to happen in the next month or so. |
Spencer, |
Outside of any tasks: import org.redline_rpm.payload.Contents Warning. In the future, this will break with newer versions of redline-rpm (yet to be released) which remove the static method. |
Thanks spencer but i was not able to get this working (using gradle 2.0.1).
At this point, i could execute the task but it seemed to be ignoring the "built in" directory i added |
I wanted to elaborate a little further on this as a possible bug. take the following full example:
Using gradle 2.0.1 and executing Both rpms try to take ownership of |
Ah. Forgot that it's using an older version of the redline classes. This used to work in some of the gradle 1.x versions (at least 1.10 and prior). It's possible that due to some better classloader isolation that you are seeing a different Contents class instance. Not sure when I'll be able to look more into this, but that's my best guess without creating an example myself with a newer gradle instance. -Spencer
|
Could this be escalated to "Bug" status? |
@cwalker67 Could you please provide a pull request containing an integration test that reproduces the issue? We can then take it from there. |
I created a test which fails on the issue. I think the main issue is that there is no (easy) way to specify a directory as "built-in". while diving in, i did manage to come up with a workaround (documented in a second test) where you create all directories with the "directory" command and then specify "addParentDirs false" when copying files. |
@cwalker67 Does your latest workaround (second test) handle the uninstall scenario. I have a similar issue and was using the addParentsDir false as a workaround, but the uninstall is not deleting the leaf folders? Were you able to get around that (without using the postUnistall script)? |
@ubhatta33 Yes. The basic gist is that you use the Note that
|
sorry, clicked the wrong button. |
Sorry, is there solution except add all directories as builtin? |
I'm kind of having a hard time trying to figure out how to configure an rpm to only manage a subset of directories being installed. for example:
when you copy the rpm out to a linux box and query the list of files managed shows:
Installation will cause the
/opt/test
directory ownership to betestuser:testgroup
even if the directory already exists. The install will also fail if the/opt/test
directory is managed by another rpm with a 'file conflict' errorWhat I would like to see from the rpm is:
But I can't figure out the correct combination of configuration to get it to work. Has anyone else ran into this?
The text was updated successfully, but these errors were encountered: