From e78c420523fb1199361b3fe690b7dedc23fec65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 17 Jun 2020 15:55:57 +0200 Subject: [PATCH] Fix python(abi) requires generator, it picked files from almost good directories The %__python_magic filter suddenly got actually working with file 5.39: Before: file.cpython-38.opt-1.pyc: data After: file.cpython-38.opt-1.pyc: python 3.8 byte-compiled Hence, the filter started to pick all Python files regardless of their location. Later, in the actual generator, paths like this were considered: /opt/usr/lib/python3.X/... And generated requirements on python(abi). We don't actually need to filter the files by file magic, so we drop it to get the previously accidentally working behavior. We could choose if the path and magic filters are applied as OR or AND. However, we don't want either. We actually want to mach any files in Python directories regardless of their magic. We *could* filter by file type (and executable bit) for provides, but that would require us to split the attr files into two. --- python-rpm-generators.spec | 5 ++++- python.attr | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python-rpm-generators.spec b/python-rpm-generators.spec index 6ea0960..5e371ae 100644 --- a/python-rpm-generators.spec +++ b/python-rpm-generators.spec @@ -1,7 +1,7 @@ Name: python-rpm-generators Summary: Dependency generators for Python RPMs Version: 11 -Release: 7%{?dist} +Release: 8%{?dist} # Originally all those files were part of RPM, so license is kept here License: GPLv2+ @@ -45,6 +45,9 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} pythondistdeps.py %{_rpmconfigdir}/pythondistdeps.py %changelog +* Wed Jun 17 2020 Miro Hrončok - 11-8 +- Fix python(abi) requires generator, it picked files from almost good directories + * Thu May 21 2020 Miro Hrončok - 11-7 - Use PEP 503 names for requires diff --git a/python.attr b/python.attr index 4000019..1793d3c 100644 --- a/python.attr +++ b/python.attr @@ -25,4 +25,3 @@ } %__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$ -%__python_magic [Pp]ython.*(executable|byte-compiled)