metadata.pl: add support for forcing sorting of profiles

Used to mix device profiles (specified in the image makefile) with
regular target profiles.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2016-05-10 14:43:46 +02:00
parent 87550a0e87
commit 1189af85fd
3 changed files with 12 additions and 1 deletions

View File

@@ -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");