From 7e1aeccd44e807074925c262e435cd3a82cb7cc3 Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Tue, 11 Jul 2023 14:58:16 +0800 Subject: [PATCH] check if the build environment supports attr before executing test (cherry picked from commit 5d1b35861a199a1a81d065ee25d83bc23fe2974d) --- pyxattr.spec | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pyxattr.spec b/pyxattr.spec index c1191f9..0c6bf32 100644 --- a/pyxattr.spec +++ b/pyxattr.spec @@ -1,7 +1,7 @@ Name: pyxattr Summary: Extended attributes library wrapper for Python Version: 0.7.2 -Release: 4 +Release: 5 License: LGPLv2+ URL: http://pyxattr.k1024.org/ Source: https://pyxattr.k1024.org/downloads/%{name}-%{version}.tar.gz @@ -33,9 +33,17 @@ cp -a . %{py3dir} %py3_install %check -export TEST_IGNORE_XATTRS=security.selinux -export PYTHONPATH=%{buildroot}%{python3_sitearch} -%{__python3} -m pytest -v +touch check-xattr-support + +if ! attr -s test -V test check-xattr-support >& /dev/null ;then + echo "skipping tests because BUILD_FILE seem to lack xattr support" +else + export TEST_IGNORE_XATTRS=security.selinux + export PYTHONPATH=%{buildroot}%{python3_sitearch} + %{__python3} -m pytest -v +fi + +rm -rf check-xattr-support %files -n python3-%{name} %{python3_sitearch}/*.so @@ -45,6 +53,9 @@ export PYTHONPATH=%{buildroot}%{python3_sitearch} %doc NEWS README.md %changelog +* Tue Jul 11 2023 fuanan - 0.7.2-5 +- check if the build environment supports attr before executing test + * Fri Dec 23 2022 zhuofeng - 0.7.2-4 - Type:bugfix - CVE:NA -- Gitee