next if $package{$depend} and $package{$depend}->{buildonly};
if ($flags =~ /\+/) {
if ($vdep = $package{$depend}->{vdepends}) {
- my @vdeps = @$vdep;
- $depend = shift @vdeps;
+ my @vdeps;
+ $depend = undef;
+
+ foreach my $v (@$vdep) {
+ if ($package{$v} && $package{$v}->{variant_default}) {
+ $depend = $v;
+ } else {
+ push @vdeps, $v;
+ }
+ }
+
+ if (!$depend) {
+ $depend = shift @vdeps;
+ }
+
if (@vdeps > 1) {
- $condition = '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
+ $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
} elsif (@vdeps > 0) {
- $condition = '!PACKAGE_'.$vdeps[0];
+ $condition = ($condition ? "$condition && " : '') . '!PACKAGE_'.$vdeps[0];
}
}
$flags =~ /@/ or $depend = "PACKAGE_$depend";
}
}
+
if ($condition) {
if ($m =~ /select/) {
next if $depend eq $condition;
$depend = "$depend if $condition";
} else {
+ next if $dep->{"$depend if $condition"};
$depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
}
}
}
}
+sub gen_usergroup_list() {
+ parse_package_metadata($ARGV[0]) or exit 1;
+ for my $name (keys %usernames) {
+ print "user $name $usernames{$name}{id} $usernames{$name}{makefile}\n";
+ }
+ for my $name (keys %groupnames) {
+ print "group $name $groupnames{$name}{id} $groupnames{$name}{makefile}\n";
+ }
+}
+
sub parse_command() {
GetOptions("ignore=s", \@ignore);
my $cmd = shift @ARGV;
/^subdirs$/ and return gen_package_subdirs();
/^license$/ and return gen_package_license(0);
/^licensefull$/ and return gen_package_license(1);
+ /^usergroup$/ and return gen_usergroup_list();
/^version_filter$/ and return gen_version_filtered_list();
}
die <<EOF
$0 subdirs [file] Package subdir information in makefile format
$0 license [file] Package license information
$0 licensefull [file] Package license information (full list)
+ $0 usergroup [file] Package usergroup allocation list
$0 version_filter [patchver] [list...] Filter list of version tagged strings
Options: