summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/metadata.pl4
-rw-r--r--scripts/metadata.pm7
2 files changed, 10 insertions, 1 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 410fa9fe24..f5afb1e47b 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -282,6 +282,10 @@ EOF
foreach my $target (@target) {
my $profiles = $target->{profiles};
+ $target->{sort} and @$profiles = sort {
+ $a->{priority} <=> $b->{priority} or
+ $a->{name} cmp $b->{name};
+ } @$profiles;
foreach my $profile (@$profiles) {
print <<EOF;
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 1891c0a6ee..3b756216a5 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -84,11 +84,16 @@ sub parse_target_metadata($) {
$profile = {
id => $1,
name => $1,
+ priority => 999,
packages => []
};
push @{$target->{profiles}}, $profile;
};
- /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+ /^Target-Profile-Name:\s*(.+)\s*$/ and do {
+ $target->{sort} = 1;
+ $profile->{name} = $1;
+ };
+ /^Target-Profile-Priority:\s*(\d+)\s*$/ and $profile->{priority} = $1;
/^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ];
/^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE);
/^Target-Profile-Config:/ and $profile->{config} = get_multiline(*FILE, "\t");