#410 [F37] Use %rpmversion to check if we are on RPM 4.19+
Merged 9 months ago by churchyard. Opened 9 months ago by churchyard.
rpms/ churchyard/pyproject-rpm-macros rpmverion  into  f37

file modified
+2 -4
@@ -106,12 +106,10 @@ 

  

  # Escaping an actual percentage sign in path by 8 signs has been verified in RPM 4.16 and 4.17.

  # See this thread http://lists.rpm.org/pipermail/rpm-list/2021-June/002048.html

- # Since RPM 4.19, 2 signs are needed instead.

+ # Since RPM 4.19, 2 signs are needed instead. 4.18.90+ is a pre-release of RPM 4.19.

  # On the CI, we build tests/escape_percentages.spec to verify the assumptions.

- # We should check RPM version here instead of Fedora/RHEL, but it's hard;

- # see https://github.com/rpm-software-management/rpm/issues/2523

  %pyproject_save_files() %{expand:\\\

- %{expr:0%{?fedora} >= 39 || 0%{?rhel} >= 10 ? "RPM_PERCENTAGES_COUNT=2" : "RPM_PERCENTAGES_COUNT=8" } \\

+ %{expr:v"0%{?rpmversion}" >= v"4.18.90" ? "RPM_PERCENTAGES_COUNT=2" : "RPM_PERCENTAGES_COUNT=8" } \\

  %{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\

    --output-files "%{pyproject_files}" \\

    --output-modules "%{_pyproject_modules}" \\

@@ -58,7 +58,7 @@ 

  

  

  %files -f %{pyproject_files}

- %if 0%{?fedora} >= 39 || 0%{?rhel} >= 10

+ %if v"0%{?rpmversion}" >= v"4.18.90"

  /two%%version

  %else

  /two%%%%%%%%version

no initial comment

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/3f254a35615646d5a2c580c3c015efca

Pull-Request has been merged by churchyard

9 months ago