Skip to content
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

Optional parents info #29

Merged
merged 2 commits into from
May 19, 2013

Conversation

merscwog
Copy link
Contributor

Forgot to add the README.md and History.md changes to my original commit.

@soid
Copy link

soid commented Mar 26, 2013

Sorry if it's not related, but issues are not available for this project. I'm trying to use addParentDirs as explained in this pull request to avoid changing ownership for parent directories as explained here: https://code.google.com/p/redline-rpm/issues/detail?id=16&can=1 but it's not working.
Below is my sample minimal project.

build.gradle

apply plugin: 'rpm'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.trigonic:gradle-rpm-plugin:1.3'
    }
}

task fooRpm(type: Rpm) {
    packageName = 'foo'
    version = '1.2.3'
    release = 1
    arch = I386
    os = LINUX

    into '/opt/myapps/foo'

    from('myfile') {
        addParentDirs = false
        user = "games"
        into 'lib'
    }
}

Here is my session of installing the result rpm:

$ ls -lh /opt/
total 40K
drwxr-xr-x 2 root   root   4.0K Jul  8  2011 bin
drwxr-xr-x 3 root   root   4.0K Jul  8  2011 include
drwxr-xr-x 4 root   root   4.0K Jul  8  2011 lib
drwxr-xr-x 2 tomcat tomcat 4.0K Mar 26 15:05 myapps
drwxr-xr-x 3 root   root   4.0K Jul  8  2011 share

$ sudo rpm -Uvh build/distributions/foo-1.2.3-1.i386.rpm
Preparing...                ########################################### [100%]
   1:foo                    ########################################### [100%]

$ ls -lh /opt/
total 40K
drwxr-xr-x 2 root  root 4.0K Jul  8  2011 bin
drwxr-xr-x 3 root  root 4.0K Jul  8  2011 include
drwxr-xr-x 4 root  root 4.0K Jul  8  2011 lib
drwxr-xr-x 3 games root 4.0K Mar 26 15:15 myapps
drwxr-xr-x 3 root  root 4.0K Jul  8  2011 share

As you can see even if myapps/ folder already existed and had 'tomcat' ownership, it has changed to 'games' after installing rpm even when I specified addParentDirs=false

@merscwog
Copy link
Contributor Author

merscwog commented Apr 4, 2013

I've just gotten a chance to look at this, and what is posted up on Maven Central for the compiled software seems a bit odd.
If you are using a newer gradle, are you getting a warning complaining about:Deprecated dynamic property: "addParentDirs" on "task ':fooRpm'", value: "false".
I'm the person who actually submitted the patch for this support, but it seems somehow that even though it shows up in the source at the github repository, versions 1.2 and 1.3 of the gradle-rpm-plugin do not seem to have the code to support addParentDirs compiled in somehow.
Attached is a version I just built from the raw github sources, and it excludes the directory creation as expected. Not sure if attachments will actually work to a response like this.
-Spencer


From: Greg Temchenko notifications@github.com
To: TrigonicSolutions/gradle-rpm-plugin gradle-rpm-plugin@noreply.github.com
Cc: Spencer Allain spencer_allain@yahoo.com
Sent: Tuesday, March 26, 2013 6:24 PM
Subject: Re: [gradle-rpm-plugin] Optional parents info (#29)

Sorry if it's not related, but issues are not available for this project. I'm trying to use addParentDirs as explained in this pull request to avoid changing ownership for parent directories as explained here: https://code.google.com/p/redline-rpm/issues/detail?id=16&can=1 but it's not working.
Below is my sample minimal project.
build.gradle
apply plugin: 'rpm' buildscript { repositories { mavenCentral() } dependencies { classpath 'com.trigonic:gradle-rpm-plugin:1.3' } } task fooRpm(type: Rpm) { packageName = 'foo' version = '1.2.3' release = 1 arch = I386 os = LINUX into '/opt/myapps/foo' from('myfile') { addParentDirs = false user = "games" into 'lib' } }
Here is my session of installing the result rpm:
$ ls -lh /opt/
total 40K
drwxr-xr-x 2 root root 4.0K Jul 8 2011 bin
drwxr-xr-x 3 root root 4.0K Jul 8 2011 include
drwxr-xr-x 4 root root 4.0K Jul 8 2011 lib
drwxr-xr-x 2 tomcat tomcat 4.0K Mar 26 15:05 myapps
drwxr-xr-x 3 root root 4.0K Jul 8 2011 share $ sudo rpm -Uvh build/distributions/foo-1.2.3-1.i386.rpm
Preparing... ########################################### [100%] 1:foo ########################################### [100%] $ ls -lh /opt/
total 40K
drwxr-xr-x 2 root root 4.0K Jul 8 2011 bin
drwxr-xr-x 3 root root 4.0K Jul 8 2011 include
drwxr-xr-x 4 root root 4.0K Jul 8 2011 lib
drwxr-xr-x 3 games root 4.0K Mar 26 15:15 myapps
drwxr-xr-x 3 root root 4.0K Jul 8 2011 share
As you can see even if myapps/ folder already existed and had 'tomcat' ownership, it has changed to 'games' after installing rpm even when I specified addParentDirs=false

Reply to this email directly or view it on GitHub.

@AlanKrueger
Copy link
Member

I'm able to replicate this on my system. It's a bit late to track down tonight, but I'll see what I can do tomorrow.

AlanKrueger added a commit that referenced this pull request May 19, 2013
@AlanKrueger AlanKrueger merged commit 41f509b into TrigonicSolutions:master May 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants