- move pkgconfig() and co to the end of the buildrequires

OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-format_spec_file?expand=0&rev=29
This commit is contained in:
Stephan Kulow 2011-12-07 14:05:00 +00:00 committed by Git OBS Bridge
parent 9174eae526
commit 996a0af0af
3 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,4 @@
SPDX Name in Spec File
AAL AAL
AFL-2.1 Academic Free License 2.1
AGPL-3.0 Affero GPL
@ -288,7 +289,6 @@ MS-PL Ms-Pl
MS-PL MS-PL
MS-RL MS-RL
Multics Multics
SPDX Name in Spec File
NASA-1.3 NASA-1.3
Naumen Naumen
NCSA NCSA

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Dec 7 14:04:46 UTC 2011 - coolo@suse.com
- move pkgconfig() and co to the end of the buildrequires
-------------------------------------------------------------------
Wed Dec 7 08:22:29 UTC 2011 - coolo@suse.com

View File

@ -231,6 +231,18 @@ sub set_current_pkg {
return ($curpack, $curlang);
}
sub sort_buildrequires_helper {
if (($a =~ /^[^#]*\(/) != ($b =~ /^[^#]*\(/)) {
if ($a =~ /^[^#]*\(/) {
1;
} else {
-1;
}
} else {
$a cmp $b;
}
}
sub read_and_parse_old_spec {
my ( $specfile, $base_package ) = @_;
my $current_package = $base_package;
@ -614,9 +626,9 @@ while ($linesmoved) {
} else {
# if there are already buildrequires, we need to sort and exit
if (@buildrequires > 0) {
my @sortedbrs = sort(@buildrequires);
my @sortedbrs = sort sort_buildrequires_helper @buildrequires;
$linesmoved = !compare_arrays(\@buildrequires, \@sortedbrs);
@oldspec = (@firstlines, sort(@buildrequires), $l, @oldspec);
@oldspec = (@firstlines, @sortedbrs, $l, @oldspec);
@firstlines = ();
@buildrequires = ();
last;