Skip to content

Commit

Permalink
Merge pull request #219 from grkg8tr/master
Browse files Browse the repository at this point in the history
Fixed issue with addParentDirs and createDirectoryEntry properties
  • Loading branch information
sghill authored Dec 14, 2016
2 parents 481c823 + 952ca0c commit ee41549
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 ee41549

Please sign in to comment.