Skip to content

Commit

Permalink
Merge pull request #436 from schwingmar/fix-320-rpm-symlink-owner
Browse files Browse the repository at this point in the history
Add user and group to symlinks in rpm
  • Loading branch information
DanielThomas authored Feb 5, 2024
2 parents 12ae9c3 + 08db51c commit c915fd6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ class Link implements Serializable {
String path
String target
int permissions = -1
String user = null
String permissionGroup = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -777,14 +777,24 @@ class SystemPackagingExtension {


Link link(String path, String target) {
link(path, target, -1)
link(path, target, -1, null, null)
}

Link link(String path, String target, int permissions) {
link(path, target, permissions, null, null)
}

Link link(String path, String target, String user, String permissionGroup) {
link(path, target, -1, user, permissionGroup)
}

Link link(String path, String target, int permissions, String user, String permissionGroup) {
Link link = new Link()
link.path = path
link.target = target
link.permissions = permissions
link.user = user
link.permissionGroup = permissionGroup
links.add(link)
link
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ class RpmCopyAction extends AbstractPackagingCopyAction<Rpm> {

@Override
protected void addLink(Link link) {
builder.addLink link.path, link.target, link.permissions
def user = link.user ?: task.user
def permissionGroup = link.permissionGroup ?: task.permissionGroup
builder.addLink(link.path, link.target, link.permissions, user, permissionGroup)
}

@Override
Expand Down

0 comments on commit c915fd6

Please sign in to comment.