From 1769a6ec0e43eb67eb91ef64ff83ecdc05be5ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 11 Mar 2026 21:16:47 +0100 Subject: [PATCH] CI: Use $ID instead of $NAME to identify the distribution See https://src.fedoraproject.org/rpms/fedora-release/pull-request/402 NAME is defined as a presentation field, not an ID field, see https://www.mankier.com/5/os-release --- plan.fmf | 8 ++++---- tests/mocktest.sh | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plan.fmf b/plan.fmf index b06b574..83abbe2 100644 --- a/plan.fmf +++ b/plan.fmf @@ -6,10 +6,10 @@ discover: tests: - name: c9s_mockbuild path: / - test: NAME="CentOS Stream" VERSION_ID=9 tests/mocktest.sh pyproject-rpm-macros + test: ID=centos VERSION_ID=9 tests/mocktest.sh pyproject-rpm-macros - name: c10s_mockbuild path: / - test: NAME="CentOS Stream" VERSION_ID=10 tests/mocktest.sh pyproject-rpm-macros + test: ID=centos VERSION_ID=10 tests/mocktest.sh pyproject-rpm-macros - name: pytest path: /tests test: ./mocktest.sh python-pytest @@ -111,10 +111,10 @@ discover: test: ./mocktest.sh config-settings-test - name: isort_c9s path: /tests - test: NAME="CentOS Stream" VERSION_ID=9 ./mocktest.sh python-isort + test: ID=centos VERSION_ID=9 ./mocktest.sh python-isort - name: isort_c10s path: /tests - test: NAME="CentOS Stream" VERSION_ID=10 ./mocktest.sh python-isort + test: ID=centos VERSION_ID=10 ./mocktest.sh python-isort prepare: - name: Install dependencies how: install diff --git a/tests/mocktest.sh b/tests/mocktest.sh index f5f0124..6119319 100755 --- a/tests/mocktest.sh +++ b/tests/mocktest.sh @@ -1,21 +1,21 @@ #!/usr/bin/bash -eux -if [ -z "${VERSION_ID-}" ] && [ -z "${NAME-}" ]; then +if [ -z "${VERSION_ID-}" ] && [ -z "${ID-}" ]; then . /etc/os-release fi version=$(echo "${VERSION_ID}" | cut -d. -f1) arch=$(rpm --eval '%{_arch}') -case $NAME in - "Fedora Linux"|"Fedora") - if [ "${VARIANT_ID-}" == "eln" ]; then +case $ID in + "fedora") + if [ "${VARIANT_ID-}" == "eln" ]; then version="eln" fi mock="fedora-${version}-${arch}" repos="local" ;; - "CentOS Stream"|"Red Hat Enterprise Linux") + "centos"|"rhel") case $version in 9) mock="centos-stream+epel-next-${version}-${arch}"