metadata.pl: fix target profile sorting check
[openwrt/staging/florian.git] / scripts / metadata.pm
index 6b10637bab54a3c442cd551f43128a5644a562d2..5f282890377112acbbe69174789993313353cf18 100644 (file)
@@ -68,7 +68,6 @@ sub parse_target_metadata($) {
                        }
                };
                /^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
-               /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
                /^Target-Arch:\s*(.+)\s*$/ and $target->{arch} = $1;
                /^Target-Arch-Packages:\s*(.+)\s*$/ and $target->{arch_packages} = $1;
                /^Target-Features:\s*(.+)\s*$/ and $target->{features} = [ split(/\s+/, $1) ];
@@ -85,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-Priority:\s*(\d+)\s*$/ and do {
+                       $profile->{priority} = $1;
+                       $target->{sort} = 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");