Skip to content

Commit fb70026

Browse files
committed
feat: allow to ignore rpms in rpmtree
When building an rpmtree allow the user to drop even more RPMs, this is needed in cases where the RPM resolution ignore rules are not enough
1 parent a80f91f commit fb70026

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/rpmtree.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ def _rpm2tar_impl(ctx):
5656
if rpm not in all_rpms:
5757
all_rpms.append(rpm)
5858

59+
to_delete = []
60+
61+
for ignore_rpm in ctx.attr.ignore_rpms:
62+
for rpm in all_rpms:
63+
if rpm.basename.startswith(ignore_rpm):
64+
to_delete.append(rpm)
65+
break
66+
67+
for rpm in to_delete:
68+
all_rpms.remove(rpm)
69+
5970
for rpm in all_rpms:
6071
args.add_all(["--input", rpm.path])
6172

@@ -96,6 +107,7 @@ _rpm2tar_attrs = {
96107
"capabilities": attr.string_list_dict(),
97108
"selinux_labels": attr.string_list_dict(),
98109
"out": attr.output(mandatory = True),
110+
"ignore_rpms": attr.string_list(default = []),
99111
}
100112

101113
_tar2files_attrs = {

0 commit comments

Comments
 (0)