From 996ac31b46e194e25fa7ddc8d9c15254f306c363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 4 Jun 2024 10:46:50 +0200 Subject: [PATCH] Add a temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators) Strip them. This workaround is safe with RPM < 4.20 or when RPM is fixed. --- pyproject-rpm-macros.spec | 6 +++++- pyproject_construct_toxenv.py | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 443c07e..bc1bdb4 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -13,7 +13,7 @@ License: MIT # Increment Y and reset Z when new macros or features are added # Increment Z when this is a bugfix or a cosmetic change # Dropping support for EOL Fedoras is *not* considered a breaking change -Version: 1.12.0 +Version: 1.12.1 Release: 1%{?dist} # Macro files @@ -171,6 +171,10 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %changelog +* Tue Jun 04 2024 Miro Hrončok - 1.12.1-1 +- Add a temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators) +- Related: rhbz#2284187 + * Fri Jan 26 2024 Miro Hrončok - 1.12.0-1 - Namespace pyproject-rpm-macros generated text files with %%{python3_pkgversion} - That way, a single-spec can be used to build packages for multiple Python versions diff --git a/pyproject_construct_toxenv.py b/pyproject_construct_toxenv.py index a2a5f96..2d148f8 100644 --- a/pyproject_construct_toxenv.py +++ b/pyproject_construct_toxenv.py @@ -11,5 +11,13 @@ def main(argv): return ','.join(args.toxenv) +def strip_x1f(argv): + r""" + Hack workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators). + https://bugzilla.redhat.com/2284187 + """ + return [a.strip('\x1f') for a in argv] + + if __name__ == '__main__': - print(main(sys.argv[1:])) + print(main(strip_x1f(sys.argv[1:])))