From a417babe4848d9dd3c776f08de4563c56fb7d77b Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Mon, 6 Nov 2023 14:06:55 -0800 Subject: [PATCH] Add support for `Obsoletes` tag in RPM definition Currently there doesn't appear to be any support `Obsoletes` in our RPM structure. This change introduces the support for the `Obsoletes` tag in the RPM specfile. Unlikely `Requires`, there doesn't appear to be a context-specific `Obsoletes`, so this is not added here. --- pkg/rpm_pfg.bzl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/rpm_pfg.bzl b/pkg/rpm_pfg.bzl index 3240c8a1..950c6ada 100644 --- a/pkg/rpm_pfg.bzl +++ b/pkg/rpm_pfg.bzl @@ -321,6 +321,8 @@ def _pkg_rpm_impl(ctx): preamble_pieces.extend(["Provides: " + p for p in ctx.attr.provides]) if ctx.attr.conflicts: preamble_pieces.extend(["Conflicts: " + c for c in ctx.attr.conflicts]) + if ctx.attr.obsoletes: + preamble.pieces.extend(["Obsoletes: " + o for o in ctx.attr.obsoletes]) if ctx.attr.requires: preamble_pieces.extend(["Requires: " + r for r in ctx.attr.requires]) if ctx.attr.requires_contextual: @@ -924,6 +926,13 @@ pkg_rpm = rule( See also: https://rpm.org/user_doc/dependencies.html """, ), + "obsoletes": attr.string_list( + doc = """List of rpm capability expressions that this package obsoletes. + + Corresponds to the "Obsoletes" preamble tag. + + See also: https://rpm-software-management.github.io/rpm/manual/dependencies.html + """, "requires": attr.string_list( doc = """List of rpm capability expressions that this package requires.