forked from pool/obs-service-format_spec_file
- 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:
parent
7af897a69c
commit
bab35e6fd3
@ -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
|
||||
|
||||
|
10
prepare_spec
10
prepare_spec
@ -624,7 +624,7 @@ read_and_parse_old_spec ( $specfile, $base_package );
|
||||
|
||||
for my $tag (qw(BuildRequires Requires Provides)) {
|
||||
my $linesmoved = 1;
|
||||
while ($linesmoved) {
|
||||
sortcycle: while ($linesmoved) {
|
||||
$linesmoved = 0;
|
||||
my @firstlines = ();
|
||||
my @tags = ();
|
||||
@ -637,10 +637,16 @@ for my $tag (qw(BuildRequires Requires Provides)) {
|
||||
if (@tags > 0) {
|
||||
my @sortedtags = sort sort_tags_helper @tags;
|
||||
$linesmoved = !compare_arrays(\@tags, \@sortedtags);
|
||||
if ($linesmoved) {
|
||||
@oldspec = (@firstlines, @sortedtags, $l, @oldspec);
|
||||
@firstlines = ();
|
||||
@tags = ();
|
||||
last;
|
||||
next sortcycle;
|
||||
} else {
|
||||
@firstlines = (@firstlines, @tags, $l);
|
||||
@tags = ();
|
||||
next;
|
||||
}
|
||||
} else {
|
||||
push(@firstlines, $l);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user