rpm-software-management / spec-cleaner

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

spec cleaner modifies contents inside # MANUAL # Tags #199

Closed simotek closed 6 years ago

simotek commented 7 years ago

Maybe I missed the point of this function but I'd like whats inside # MANUAL # not to be modified, here's a test case

# MANUAL #
%package apparmor
%pattern_basetechnologies
Summary:        AppArmor
Group:          Metapackages
Provides:       patterns-openSUSE-apparmor = %{version}
Provides:       pattern() = apparmor
Provides:       pattern-icon() = pattern-apparmor
Provides:       pattern-order() = 1100
Provides:       pattern-visible()
Obsoletes:      patterns-openSUSE-apparmor < %{version}
Requires:       pattern() = minimal_base
Recommends:     pattern() = apparmor_opt
# /MANUAL #

Requires:       apparmor-abstractions
Requires:       apparmor-parser
Requires:       apparmor-profiles
Requires:       audit
Recommends:     apparmor-utils`
scarabeusiv commented 7 years ago

It is not for disabling spec-cleaner but for sections that were added ie by human contrary to rest of the spec being auto-generated. Mostly used in ruby packaging.

The idea and logic around it is the keywords behave like %if and %endif

simotek commented 7 years ago

Ok so what i'm looking for I guess is a # IGNORE # and # /IGNORE # for things that are too hard for or not worth teaching spec cleaner. Unless I hack in that Provides: pattern-* always comes before requires and recommends and use that in conjunction with blocks

scarabeusiv commented 7 years ago

I am still unsure how to implement this reliably. Couldn't we rather really devise tests for the patterns and make sure we match it up correctly?

simotek commented 7 years ago

We could but we would have to implement special cases such that Requires: pattern()* and Recommends: pattern()* and I guess Suggests: pattern()* for completeness come last. I don't know which of the too is the least bad option.

If you replace the # Manual # in the example above with a code block you have a test case that should stay unchanged, currently the Requires and Recommends jumps to the top of the code block

DimStar77 commented 6 years ago

Seems we could close this on in favor of https://github.com/openSUSE/spec-cleaner/issues/224 - which is WIP (and was more specifically reported to be for patterns; this issue here mentioned pattern more as a side-effect)

scarabeusiv commented 6 years ago

Makes sense. Closing up.