rpm-software-management / spec-cleaner

spec-cleaner
BSD 3-Clause "New" or "Revised" License
28 stars 34 forks source link

moving BuildArch wrongly #249

Closed pgajdos closed 5 years ago

pgajdos commented 5 years ago

spec-cleaner wants to do for home:pgajdos/python-h11:

--- python-h11.spec 2019-06-05 10:46:03.930448848 +0200
+++ python-h11.spec.new 2019-06-05 10:47:48.219017822 +0200
@@ -28,10 +28,10 @@ Source:         https://files.pythonhost
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+BuildArch:      noarch
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
 # /SECTION
-BuildArch:      noarch
 %python_subpackages

 %description

I think this is not correct.

scarabeusiv commented 5 years ago

Actually it is correct behaviour. Best we could come up with the section tag is to put them at the end of the Preamble block and sort them out. So anything else in preamble takes priority over the %if/... unless it alters defines/etc, when it is put on the top. %python_subpackages is by the parser not recognised as part of the preamble but just unknown macro so that is why it is not moved.