From 988ad7dcc9856548281a2d524cb4018556c47ca763c6606997a9f58cd7b2a6b7 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 9 Feb 2012 10:36:17 +0000 Subject: [PATCH] - fix the whitespace after the preamble OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=57 --- obs-service-format_spec_file.changes | 5 +++++ prepare_spec | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/obs-service-format_spec_file.changes b/obs-service-format_spec_file.changes index c1fe3b7..3ad932c 100644 --- a/obs-service-format_spec_file.changes +++ b/obs-service-format_spec_file.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 9 10:36:01 UTC 2012 - coolo@suse.com + +- fix the whitespace after the preamble + ------------------------------------------------------------------- Mon Feb 6 12:33:12 UTC 2012 - coolo@suse.com diff --git a/prepare_spec b/prepare_spec index b100e5a..2c4756a 100644 --- a/prepare_spec +++ b/prepare_spec @@ -674,12 +674,14 @@ print "# needsrootforbuild\n" if $needsrootforbuild; print "# needsbinariesforbuild\n" if $needsbinariesforbuild; print "# nodebuginfo\n" if $nodebuginfo; print "# icecream $icecreamforbuild\n" if $icecreamforbuild ne ''; -print "\n" if ($needsrootforbuild || $needsbinariesforbuild || $nodebuginfo || $icecreamforbuild ne ''); +#print "\n" if ($needsrootforbuild || $needsbinariesforbuild || $nodebuginfo || $icecreamforbuild ne ''); -while ($oldspec[0] eq "XXXBLANKLINE") { +while ($oldspec[0] eq "XXXBLANKLINE" || $oldspec[0] eq "XXXDOUBLELINE") { shift @oldspec; } +print "\n\n"; + my $license_unique = !grep { $_ ne $main_license } values %seen_licenses; my $groups_unique = !grep { $_ ne $main_group } values %seen_groups; # we need to have unique groups in the spec file as long as we support SLE11 ;( @@ -689,6 +691,7 @@ my $first_summary = 1; my $line; while (@oldspec) { $line = shift @oldspec; + if ($line eq "XXXBLANKLINE") { print "\n" unless $oldspec[0] && ($oldspec[0] =~ m/^XXX.*LINE/ || $oldspec[0] =~ /^\s*$/ || $oldspec[0] =~ /^\n/); } elsif ($line eq "XXXDOUBLELINE") {