use base 'Exporter';
use strict;
use warnings;
-our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
our %package;
our %vpackage;
our %srcpackage;
our %category;
-our %features;
our %overrides;
our @ignore;
/^Target-Optimization:\s*(.+)\s*$/ and $target->{cflags} = $1;
/^CPU-Type:\s*(.+)\s*$/ and $target->{cputype} = $1;
/^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
+ /^Linux-Testing-Version:\s*(.+)\s*$/ and $target->{testing_version} = $1;
/^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
/^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
/^Default-Subtarget:\s*(.+)\s*$/ and $target->{def_subtarget} = $1;
$profile = {
id => $1,
name => $1,
+ has_image_metadata => 0,
+ supported_devices => [],
priority => 999,
- packages => []
+ packages => [],
+ default => "y if TARGET_ALL_PROFILES"
};
$1 =~ /^DEVICE_/ and $target->{has_devices} = 1;
push @{$target->{profiles}}, $profile;
};
/^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+ /^Target-Profile-hasImageMetadata:\s*(\d+)\s*$/ and $profile->{has_image_metadata} = $1;
+ /^Target-Profile-SupportedDevices:\s*(.+)\s*$/ and $profile->{supported_devices} = [ split(/\s+/, $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-Default:\s*(.+)\s*$/ and $profile->{default} = $1;
}
close FILE;
foreach my $target (@target) {
%vpackage = ();
%srcpackage = ();
%category = ();
- %features = ();
%overrides = ();
%usernames = ();
%groupnames = ();
sub parse_package_metadata($) {
my $file = shift;
my $pkg;
- my $feature;
my $src;
my $override;
my %ignore = map { $_ => 1 } @ignore;
};
next unless $src;
/^Package:\s*(.+?)\s*$/ and do {
- undef $feature;
$pkg = {};
$pkg->{src} = $src;
$pkg->{name} = $1;
$vpackage{$1} or $vpackage{$1} = [];
unshift @{$vpackage{$1}}, $pkg;
};
- /^Feature:\s*(.+?)\s*$/ and do {
- undef $pkg;
- $feature = {};
- $feature->{name} = $1;
- $feature->{priority} = 0;
- };
- $feature and do {
- /^Target-Name:\s*(.+?)\s*$/ and do {
- $features{$1} or $features{$1} = [];
- push @{$features{$1}}, $feature unless $src->{ignore};
- };
- /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1;
- /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1;
- /^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1;
- /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
- next;
- };
/^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ];
/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ];
/^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ];
next unless $pkg;
/^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
+ /^ABIVersion: \s*(.+)\s*$/ and $pkg->{abiversion} = $1;
/^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
/^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
/^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
my @vpkg = split /\s+/, $1;
@{$pkg->{provides}} = ($pkg->{name}, @vpkg);
foreach my $vpkg (@vpkg) {
+ next if ($vpkg eq $pkg->{name});
$vpackage{$vpkg} or $vpackage{$vpkg} = [];
push @{$vpackage{$vpkg}}, $pkg;
}
for my $ugspec (@ugspecs) {
my @ugspec = split /:/, $ugspec, 2;
- parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
- if (@ugspec > 1) {
+ if ($ugspec[0]) {
+ parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
+ }
+ if ($ugspec[1]) {
parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0;
}
}