spec file rewrite on local rebuilds deliberately removes comments
Hi, building https://build.opensuse.org/package/show/home:frispete:test/freerdp locally with osc, I noticed a very unpleasant behavior. The spec file rewriter removed all lines of the third comment on top of this file. In fact, anything commented out in this area deliberately gets removed. Is this on purpose? I guess, the spec is piped through spec-cleaner, and it even removes this: #nospeccleaner Urmpf. Best, Pete
On 8/19/21 12:12 PM, Hans-Peter Jansen wrote:
Hi,
building https://build.opensuse.org/package/show/home:frispete:test/freerdp locally with osc, I noticed a very unpleasant behavior. The spec file rewriter removed all lines of the third comment on top of this file. In fact, anything commented out in this area deliberately gets removed.
Is this on purpose?
I guess, the spec is piped through spec-cleaner, and it even removes this:
#nospeccleaner
If you install spec-cleaner-format_spec_file, format_spec_file is replaced by spec-cleaner's minimal mode. If you didn't, it's still the default format_spec_file - which doesn't care for spec cleaner comments. Greetings, Stephan
On Thursday 2021-08-19 12:28, Stephan Kulow wrote:
On 8/19/21 12:12 PM, Hans-Peter Jansen wrote:
Hi,
building https://build.opensuse.org/package/show/home:frispete:test/freerdp locally with osc, I noticed a very unpleasant behavior. The spec file rewriter removed all lines of the third comment on top of this file. In fact, anything commented out in this area deliberately gets removed.
Is this on purpose?
I guess, the spec is piped through spec-cleaner, and it even removes this:
#nospeccleaner
If you install spec-cleaner-format_spec_file, format_spec_file is replaced by spec-cleaner's minimal mode. If you didn't, it's still the default format_spec_file - which doesn't care for spec cleaner comments.
But format_spec_file is not nearly as "destructive" as spec-cleaner. ► cp test.spec test1.spec ► /usr/lib/obs/service/format_spec_file --specfile test.spec ► diff -dpru test1.spec test.spec --- test1.spec 2021-08-19 12:31:41.954436386 +0200 +++ test.spec 2021-08-19 12:31:50.594461368 +0200 @@ -17,6 +17,6 @@ #nospeccleaner -Name: test +Name: test %changelog
Am Donnerstag, 19. August 2021, 12:32:20 CEST schrieb Jan Engelhardt:
On Thursday 2021-08-19 12:28, Stephan Kulow wrote:
If you install spec-cleaner-format_spec_file, format_spec_file is replaced by spec-cleaner's minimal mode. If you didn't, it's still the default format_spec_file - which doesn't care for spec cleaner comments.
But format_spec_file is not nearly as "destructive" as spec-cleaner.
Jan, format_spec_file simply runs: /usr/bin/spec-cleaner -m -f "$i" -i As noted before, even minimal mode is too destructive for my taste. Best, Pete
On Friday 2021-08-20 12:31, Hans-Peter Jansen wrote:
Am Donnerstag, 19. August 2021, 12:32:20 CEST schrieb Jan Engelhardt:
On Thursday 2021-08-19 12:28, Stephan Kulow wrote:
If you install spec-cleaner-format_spec_file, format_spec_file is replaced by spec-cleaner's minimal mode. If you didn't, it's still the default format_spec_file - which doesn't care for spec cleaner comments.
But format_spec_file is not nearly as "destructive" as spec-cleaner.
Jan, format_spec_file simply runs:
/usr/bin/spec-cleaner -m -f "$i" -i
My format_spec_file calls prepare_spec (this is obs-service_format_spec_file): if /usr/lib/obs/service/format_spec_file.files/prepare_spec "$i" > "$MYOUTDIR/$i.$$"; then # remove all file files which are indendical to committed files And prepare_spec isn't as destructive.
Am Donnerstag, 19. August 2021, 12:28:49 CEST schrieb Stephan Kulow:
On 8/19/21 12:12 PM, Hans-Peter Jansen wrote:
Hi,
building https://build.opensuse.org/package/show/home:frispete:test/freerdp locally with osc, I noticed a very unpleasant behavior. The spec file rewriter removed all lines of the third comment on top of this file. In fact, anything commented out in this area deliberately gets removed.
Is this on purpose?
I guess, the spec is piped through spec-cleaner, and it even removes this:
#nospeccleaner
If you install spec-cleaner-format_spec_file, format_spec_file is replaced by spec-cleaner's minimal mode. If you didn't, it's still the default format_spec_file - which doesn't care for spec cleaner comments.
Well, installing this resulted in: The following NEW package is going to be installed: spec-cleaner-format_spec_file 1.2.1-3.1 The following package is going to be REMOVED: obs-service-format_spec_file 20210511-1.1 which I accepted. IMHO, the result deserved a report: https://github.com/rpm-software-management/spec-cleaner/issues/291 Best, Pete
participants (3)
-
Hans-Peter Jansen
-
Jan Engelhardt
-
Stephan Kulow