Skip to content

Commit

Permalink
Fixed issue with addParentDirs and createDirectoryEntry properties no…
Browse files Browse the repository at this point in the history
…t being handled properly.

Also added test to catch future regression. Fixes issues #124 and #212
  • Loading branch information
nicknezis committed Dec 14, 2016
1 parent 481c823 commit 952ca0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class RpmCopyAction extends AbstractPackagingCopyAction<Rpm> {

int fileMode = lookup(specToLookAt, 'fileMode') ?: fileDetails.mode
def specAddParentsDir = lookup(specToLookAt, 'addParentDirs')
boolean addParentsDir = specAddParentsDir ?: task.addParentDirs
boolean addParentsDir = specAddParentsDir!=null ? specAddParentsDir : task.addParentDirs

rpmFileVisitorStrategy.addFile(fileDetails, inputFile, fileMode, -1, fileType, user, group, addParentsDir)
}
Expand All @@ -128,9 +128,9 @@ class RpmCopyAction extends AbstractPackagingCopyAction<Rpm> {
}
// Have to take booleans specially, since they would fail an elvis operator if set to false
def specCreateDirectoryEntry = lookup(specToLookAt, 'createDirectoryEntry')
boolean createDirectoryEntry = specCreateDirectoryEntry ?: task.createDirectoryEntry
boolean createDirectoryEntry = specCreateDirectoryEntry!=null ? specCreateDirectoryEntry : task.createDirectoryEntry
def specAddParentsDir = lookup(specToLookAt, 'addParentDirs')
boolean addParentsDir = specAddParentsDir ?: task.addParentDirs
boolean addParentsDir = specAddParentsDir!=null ? specAddParentsDir : task.addParentDirs

if (createDirectoryEntry) {
logger.debug 'adding directory {}', dirDetails.relativePath.pathString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'() {
Expand Down

0 comments on commit 952ca0c

Please sign in to comment.