1
0

- fix sorting of tag lines that are not on the beginning of the file

OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=64
This commit is contained in:
Stephan Kulow 2012-02-20 13:19:27 +00:00 committed by Git OBS Bridge
parent 7af897a69c
commit bab35e6fd3
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Feb 20 13:19:09 UTC 2012 - coolo@suse.com
- fix sorting of tag lines that are not on the beginning of the file
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 20 08:15:52 UTC 2012 - coolo@suse.com Mon Feb 20 08:15:52 UTC 2012 - coolo@suse.com

View File

@ -624,7 +624,7 @@ read_and_parse_old_spec ( $specfile, $base_package );
for my $tag (qw(BuildRequires Requires Provides)) { for my $tag (qw(BuildRequires Requires Provides)) {
my $linesmoved = 1; my $linesmoved = 1;
while ($linesmoved) { sortcycle: while ($linesmoved) {
$linesmoved = 0; $linesmoved = 0;
my @firstlines = (); my @firstlines = ();
my @tags = (); my @tags = ();
@ -637,10 +637,16 @@ for my $tag (qw(BuildRequires Requires Provides)) {
if (@tags > 0) { if (@tags > 0) {
my @sortedtags = sort sort_tags_helper @tags; my @sortedtags = sort sort_tags_helper @tags;
$linesmoved = !compare_arrays(\@tags, \@sortedtags); $linesmoved = !compare_arrays(\@tags, \@sortedtags);
@oldspec = (@firstlines, @sortedtags, $l, @oldspec); if ($linesmoved) {
@firstlines = (); @oldspec = (@firstlines, @sortedtags, $l, @oldspec);
@tags = (); @firstlines = ();
last; @tags = ();
next sortcycle;
} else {
@firstlines = (@firstlines, @tags, $l);
@tags = ();
next;
}
} else { } else {
push(@firstlines, $l); push(@firstlines, $l);
} }