From 629f5b480303673b4276d64e4bf50c56d0afb286 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sat, 20 Jul 2019 10:43:08 -0400 Subject: [PATCH] Fix the pyxattr dependency to allow kiwi to function Most Linux distributions offer the pyxattr module, including openSUSE Tumbleweed. Going forward, we will use the pyxattr module by default as a dependency and only switch back to the other xattr module when on older SUSE Linux distributions that lack the pyxattr module. Note that because kiwi uses setuptools to create the CLI entry points, kiwi checks the Python dependencies before executing, so we change the dependency in the setup.py accordingly so that it will not fail to start. --- package/python-kiwi-spec-template | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package/python-kiwi-spec-template b/package/python-kiwi-spec-template index aeaf11dd175..83630cebbb2 100644 --- a/package/python-kiwi-spec-template +++ b/package/python-kiwi-spec-template @@ -92,7 +92,7 @@ Requires: python%{python3_pkgversion}-docopt Requires: python%{python3_pkgversion}-lxml Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-setuptools -%if 0%{?suse_version} +%if (0%{?suse_version} && 0%{?suse_version} < 1550) Requires: python%{python3_pkgversion}-xattr %else Requires: python%{python3_pkgversion}-pyxattr @@ -355,6 +355,11 @@ Provides manual pages to describe the kiwi commands # as an independent script sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py +%if 0%{?suse_version} && 0%{?suse_version} < 1550 +# For older SUSE distributions, use the other xattr Python module +sed -e "s|pyxattr|xattr|" -i setup.py +%endif + %build # Build Python 3 version python3 setup.py build --cflags="${RPM_OPT_FLAGS}" diff --git a/setup.py b/setup.py index 3c75a274be7..034e3b7d618 100755 --- a/setup.py +++ b/setup.py @@ -186,7 +186,7 @@ def run(self): 'install_requires': [ 'docopt>=0.6.2', 'lxml', - 'xattr', + 'pyxattr', 'requests', 'PyYAML' ],