Skip to content

Commit 94a7915

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 49d0ec1 commit 94a7915

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
@@ -57,6 +57,17 @@ def _rpm2tar_impl(ctx):
5757
if rpm not in all_rpms:
5858
all_rpms.append(rpm)
5959

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

@@ -112,6 +123,7 @@ _rpm2tar_attrs = {
112123
"capabilities": attr.string_list_dict(),
113124
"selinux_labels": attr.string_list_dict(),
114125
"out": attr.output(mandatory = True),
126+
"ignore_rpms": attr.string_list(default = []),
115127
}
116128

117129
_tar2files_attrs = {

0 commit comments

Comments
 (0)