From 590b3ccd306ab4b91be52d305ba5ea0eaabb865e Mon Sep 17 00:00:00 2001 From: weiwei_tiantian Date: Sat, 20 Nov 2021 11:21:35 +0800 Subject: [PATCH] check if the build environment supports attr before executing test (cherry picked from commit 3eec00b8ac4a317d9c87e8dea674ccda5353f8c3) --- pyxattr.spec | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pyxattr.spec b/pyxattr.spec index 7fe0895..8013155 100644 --- a/pyxattr.spec +++ b/pyxattr.spec @@ -1,7 +1,7 @@ Name: pyxattr Summary: Extended attributes library wrapper for Python Version: 0.6.1 -Release: 2 +Release: 3 License: LGPLv2+ URL: http://pyxattr.k1024.org/ Source: https://pyxattr.k1024.org/downloads/%{name}-%{version}.tar.gz @@ -53,12 +53,20 @@ pushd %{py3dir} popd %check -export TEST_IGNORE_XATTRS=security.selinux -%{__python2} setup.py test +touch check-xattr-support -pushd %{py3dir} -%{__python3} setup.py test -popd +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 + %{__python2} setup.py test + + pushd %{py3dir} + %{__python3} setup.py test + popd +fi + +rm -rf check-xattr-support %files -n python2-%{name} %{python2_sitearch}/*.so @@ -75,6 +83,9 @@ popd %doc NEWS README.rst %changelog +* Tue Nov 23 2021 wangjie - 0.6.1-3 +- check if the build environment supports attr before executing test + * Tue Aug 18 2020 yangzhuangzhuang - 0.6.1-2 - rebuild for requirement package update -- Gitee