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

Add user and group to symlinks in rpm #436

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading