From d271fc1938e0fe12e1f1a450c67fa850de290279 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 14 Nov 2024 11:05:29 -0500 Subject: [PATCH] Make the Azure template work with both dnf4 and dnf5 Add a version test to call dnf builddep differently based on release. Remove --skip-broken when calling dnf builddep. This was an old workaround from 2019. The option is no longer supported with dnf5. First seen in F41. Drop in all calls. dnf5 doesn't take a --spec option. It has to be passed a spec file. So in that case copy freeipa.spec.in to freeipa.spec and call. Signed-off-by: Rob Crittenden Reviewed-By: Florence Blanc-Renaud --- ipatests/azure/templates/prepare-build-fedora.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ipatests/azure/templates/prepare-build-fedora.yml b/ipatests/azure/templates/prepare-build-fedora.yml index 3a74d7f2a..66a47266b 100644 --- a/ipatests/azure/templates/prepare-build-fedora.yml +++ b/ipatests/azure/templates/prepare-build-fedora.yml @@ -26,5 +26,13 @@ steps: echo "Installing FreeIPA development dependencies" sudo dnf builddep -y freeipa - sudo dnf builddep -y --skip-broken -D "with_wheels 1" -D "with_lint 1" -D "with_doc 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False + version=$(grep VERSION_ID /etc/os-release |cut -d= -f2) + if [ $version -ge 41 ]; then + cp freeipa.spec.in freeipa.spec + sudo dnf builddep -y -D "with_wheels 1" -D "with_lint 1" -D "with_doc 1" --best --allowerasing --setopt=install_weak_deps=False freeipa.spec + rm -f freeipa.spec + else + sudo dnf builddep -y -D "with_wheels 1" -D "with_lint 1" -D "with_doc 1" --spec freeipa.spec.in --best --allowerasing --setopt=install_weak_deps=False + fi + displayName: Prepare build environment