From 8d079510db88cca1891df9ccba23d0d916c63077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 23 Nov 2022 17:03:09 +0100 Subject: [PATCH] Don't measure wheel size with du The `du` tool estimates disk usage, so filesystem settings (block size, compression, holes, etc.) might change the result. Use `stat` instead for a more reproducible result. Note that I've changed 900 (KiB) to 900000 (bytes) which is in fact not correct (900 KiB is 921600 bytes), but I assumed a human-readable round number works better here. I've updated the comment to say kB instead of KiB. Fixes https://bugzilla.redhat.com/2143393 --- python-setuptools.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index 0dd9834..1382bd1 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -180,9 +180,9 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt %{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python%{python3_pkgversion}dist' --compare-with '%{bundled}' -# Regression test, the wheel should not be larger than 900 KiB +# Regression test, the wheel should not be larger than 900 kB # https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3 -test $(du %{_pyproject_wheeldir}/%{python_wheel_name} | cut -f1) -lt 900 +test $(stat --format %%s %{_pyproject_wheeldir}/%{python_wheel_name}) -lt 900000 # Regression test, the tests are not supposed to be installed test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests