use base 'Exporter';
use strict;
use warnings;
-our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
+our @EXPORT = qw(%package %srcpackage %category %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames);
our %package;
our %preconfig;
our %srcpackage;
our %category;
-our %subdir;
our %features;
our %overrides;
our @ignore;
}
sub clear_packages() {
- %subdir = ();
%preconfig = ();
%package = ();
%srcpackage = ();
};
while (<FILE>) {
chomp;
- /^Source-Makefile: \s*((?:package\/)?((?:.+\/)?)([^\/]+)\/Makefile)\s*$/ and do {
- $subdir{$3} = $2;
-
+ /^Source-Makefile: \s*((?:package\/)?((?:.+\/)?([^\/]+))\/Makefile)\s*$/ and do {
$src = {
makefile => $1,
- subdir => $2,
+ path => $2,
name => $3,
ignore => $ignore{$3},
packages => [],
$pkg->{title} = "";
$pkg->{depends} = [];
$pkg->{mdepends} = [];
- $pkg->{subdir} = $src->{subdir};
$pkg->{tristate} = 1;
$pkg->{override} = $override;
$package{$1} = $pkg;
name => $vpkg,
vdepends => [],
src => $src,
- subdir => $src->{subdir},
makefile => $src->{makefile},
};
push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
parse_package_metadata($ARGV[0]) or exit 1;
foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) {
my $src = $srcpackage{$srcname};
- my $path = $subdir{$srcname}.$srcname;
my $variant_default;
my @srcdeps;
my $config = '';
$config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly};
- $pkg->{prereq} and print "prereq-$config += $path\n";
+ $pkg->{prereq} and print "prereq-$config += $src->{path}\n";
next if $pkg->{buildonly};
- print "package-$config += $path\n";
+ print "package-$config += $src->{path}\n";
if ($pkg->{variant}) {
if (!defined($variant_default) or $pkg->{variant_default}) {
$variant_default = $pkg->{variant};
}
- print "\$(curdir)/$path/variants += \$(if $config,$pkg->{variant})\n";
+ print "\$(curdir)/$src->{path}/variants += \$(if $config,$pkg->{variant})\n";
}
}
if (defined($variant_default)) {
- print "\$(curdir)/$path/default-variant := $variant_default\n";
+ print "\$(curdir)/$src->{path}/default-variant := $variant_default\n";
}
unless (grep {!$_->{buildonly}} @{$src->{packages}}) {
- print "package- += $path\n";
+ print "package- += $src->{path}\n";
}
if (@{$src->{buildtypes}} > 0) {
- print "buildtypes-$path = ".join(' ', @{$src->{buildtypes}})."\n";
+ print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n";
}
foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
$src->{makefile}, $type, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{makefile}, $deptype;
next;
}
- $idx = $pkg_dep->{subdir}.$pkg_dep->{src}{name};
+ $idx = $pkg_dep->{src}{path};
} elsif (defined($srcpackage{$dep})) {
- $idx = $subdir{$dep}.$dep;
+ $idx = $srcpackage{$dep}{path};
} else {
next;
}
}
my $depline = join(" ", sort keys %deplines);
if ($depline) {
- $line .= "\$(curdir)/$path/$type/compile += $depline\n";
+ $line .= "\$(curdir)/$src->{path}/$type/compile += $depline\n";
}
}
$src->{makefile}, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{makefile}, $deptype;
next;
}
- $idx = $pkg_dep->{subdir}.$pkg_dep->{src}{name};
+ $idx = $pkg_dep->{src}{path};
} elsif (defined($srcpackage{$dep})) {
- $idx = $subdir{$dep}.$dep;
+ $idx = $srcpackage{$dep}{path};
}
if ($idx) {
}
my $depline = join(" ", sort keys %deplines);
if ($depline) {
- $line .= "\$(curdir)/$path/compile += $depline\n";
+ $line .= "\$(curdir)/$src->{path}/compile += $depline\n";
}
}