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

is it possible to have different addParentDirs and/or createDirectoryEntry per from or into? #212

Closed
samuelrivas opened this issue Oct 25, 2016 · 3 comments

Comments

@samuelrivas
Copy link

I have different things to copy to the rpm, and for some I want to create directories and for others I don't. I tried to do something like

    task("serviceRpm", type: Rpm) {
      description "blah"

      os LINUX
      type BINARY
      arch NOARCH
      packageDescription "TBD"
      summary "TBD"
      url "foo"
      vendor "foo"
      packager "foo"
      version "0"
      release "1234"

      from(stagingDir) {

        createDirectoryEntry = true
        addParentDirs = true

        user osUser
        permissionGroup osGroup
        into "/whatever"
      }

      from("/tmp/test") {

        createDirectoryEntry = false
        addParentDirs = false

        user osUser
        permissionGroup osGroup
        into "/whatever-else"
      }
}

But it seems the configuration from the second block (/tmp/test -> /whatever-else) is applied to both copies. The same is true if I set both to true in the second and both to true in the first, the behaviour is as if both variables were true in both copies

@samuelrivas
Copy link
Author

Actually, directory creation control doesn't seem to work the way I understand it. Unless I don't understand the test suite, this patch extends the RpmPluginTest so that it checks that directories are not created when addParentDirs is false, but that fails as all /a, ./a/path, ./a/path/not, ./a/path/not/to, ./a/path/not/to/create, ./a/path/not/to/create/alone directories are created

diff --git a/src/test/groovy/com/netflix/gradle/plugins/rpm/RpmPluginTest.groovy b/src/test/groovy/com/netflix/gradle/plugins/rpm/RpmPluginTest.groovy
index 133b9cc..53dbabe 100755
--- a/src/test/groovy/com/netflix/gradle/plugins/rpm/RpmPluginTest.groovy
+++ b/src/test/groovy/com/netflix/gradle/plugins/rpm/RpmPluginTest.groovy
@@ -107,6 +107,11 @@ class RpmPluginTest extends ProjectSpec {
                 path.startsWith(fileName)
             }
         }
+        scan.files*.name.every { fileName ->
+            ['./a/path/not/to/create'].every { path ->
+                ! path.startsWith(fileName)
+            }
+        }
     }

     def 'obsoletesAndConflicts'() {

@joelanford
Copy link

I think this is related to #182.

nicknezis added a commit to nicknezis/gradle-ospackage-plugin that referenced this issue Dec 14, 2016
…t being handled properly.

Also added test to catch future regression. Fixes issues nebula-plugins#124 and nebula-plugins#212
@sghill
Copy link
Contributor

sghill commented Dec 15, 2016

Fixed with the release of v4.3.0 today

@sghill sghill closed this as completed Dec 15, 2016
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

No branches or pull requests

3 participants