Move a verbose line of %pyproject_buildrequires from stdout to stderr

The `rm -v` command prints the output to stderr, polluting the generated buildrequires

  $ rm -rfv pytest_harvest.dist-info/
  removed 'pytest_harvest.dist-info/METADATA'
  removed 'pytest_harvest.dist-info/LICENSE'
  removed 'pytest_harvest.dist-info/top_level.txt'
  removed 'pytest_harvest.dist-info/entry_points.txt'
  removed directory 'pytest_harvest.dist-info/'

This can lead to RPM errors:

  error: Dependency tokens must begin with alpha-numeric, '_' or '/': 'pytest_harvest.dist-info/METADATA'

Or bogus dependencies -- the SRPM requires "removed" and "directory".

See https://github.com/rpm-software-management/rpm/pull/889
This commit is contained in:
Miro Hrončok 2019-10-08 13:01:08 +02:00
parent 2a3b101709
commit 102626373e
2 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,7 @@ echo 'python3-devel'
echo 'python3dist(packaging)'
echo 'python3dist(pytoml)'
# setuptools assumes no pre-existing dist-info
rm -rfv *.dist-info/
rm -rfv *.dist-info/ >&2
if [ -f %{__python3} ]; then
RPM_TOXENV="%{toxenv}" %{__python3} -I %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?**}
fi

View File

@ -6,7 +6,7 @@ License: MIT
# Keep the version at zero and increment only release
Version: 0
Release: 6%{?dist}
Release: 7%{?dist}
Source0: macros.pyproject
Source1: pyproject_buildrequires.py
@ -87,6 +87,9 @@ install -m 644 pyproject_buildrequires.py %{buildroot}%{_rpmconfigdir}/redhat/
%license LICENSE
%changelog
* Tue Oct 08 2019 Miro Hrončok <mhroncok@redhat.com> - 0-7
- Move a verbose line of %%pyproject_buildrequires from stdout to stderr
* Fri Jul 26 2019 Petr Viktorin <pviktori@redhat.com> - 0-6
- Use importlib_metadata rather than pip freeze