rpm-software-management / spec-cleaner

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

spec-cleaner moves BuildRequires: inside conditional away #257

Closed mwilck closed 5 years ago

mwilck commented 5 years ago

This spec file contains a section with BuildRequires: inside a conditional:

BuildRequires:  update-desktop-files
if 0%{?with_new_pycups}
# All printer driver packages should have "BuildRequires: cups-rpm-helper"
# for automatic generation of Provides: tags.
BuildRequires:  cups-rpm-helper
%endif

When I run spec-cleaner on it (or format_spec_file, FTM), it moves that section down below all Requires: and Obsoletes:

I wonder if that's intended behavior?

mwilck commented 5 years ago

This is the spec file after running spec-cleaner over it.

scarabeusiv commented 5 years ago

This is an intended behaviour indeed, the conditions are all moved in one location in the spec. It allows for easier review of all available conditionals later on.

scarabeusiv commented 5 years ago

Basically detecting the conditions and the alphabetic sorting caused all sort of trouble with nested conditions so we had to do something that could be reliably reproducable, and this was least worst of all the posible solutions.