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

rpm: Add conflicts and obsoletes to sub RPMs #851

Merged
merged 1 commit into from
Apr 16, 2024
Merged
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
12 changes: 12 additions & 0 deletions pkg/rpm_pfg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ PackageSubRPMInfo = provider(
"version": "RPM `Version` tag for this subpackage",
"requires": "List of RPM capability expressions that this package requires",
"provides": "List of RPM capability expressions that this package provides",
"conflicts": "List of RPM capability expressions that conflict with this package",
"obsoletes": "List of RPM capability expressions that this package obsoletes",
"srcs": "Mapping groups to include in this RPM",
},
)
Expand Down Expand Up @@ -326,6 +328,12 @@ def _process_subrpm(ctx, rpm_name, rpm_info, rpm_ctx):
for p in rpm_info.provides:
rpm_lines += ["Provides: %s" % p]

for c in rpm_info.conflicts:
rpm_lines += ["Conflicts: %s" % c]

for o in rpm_info.obsoletes:
rpm_lines += ["Obsoletes: %s" % o]

rpm_lines += [
"",
"%%description %s" % rpm_info.package_name,
Expand Down Expand Up @@ -1205,6 +1213,8 @@ def _pkg_sub_rpm_impl(ctx):
version = ctx.attr.version,
requires = ctx.attr.requires,
provides = ctx.attr.provides,
conflicts = ctx.attr.conflicts,
obsoletes = ctx.attr.obsoletes,
srcs = ctx.attr.srcs,
),
DefaultInfo(
Expand Down Expand Up @@ -1239,6 +1249,8 @@ pkg_sub_rpm = rule(
"version": attr.string(doc = "RPM `Version` tag for this subrpm"),
"requires": attr.string_list(doc = "List of RPM capability expressions that this package requires"),
"provides": attr.string_list(doc = "List of RPM capability expressions that this package provides"),
"conflicts": attr.string_list(doc = "List of RPM capability expressions that conflict with this package"),
"obsoletes": attr.string_list(doc = "List of RPM capability expressions that this package obsoletes"),
"srcs": attr.label_list(
doc = "Mapping groups to include in this RPM",
mandatory = True,
Expand Down