summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-12-28 13:10:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-12-28 13:10:23 +0000
commitf541a6036c4b43bdfb0a45873c62e2c828daeb9e (patch)
treee86494ebf43323c5b51155746a08f47110c16a02 /perl-install/pkgs.pm
parent62a0a2936b8d05d04db3fe45694010a09fbb3730 (diff)
downloaddrakx-f541a6036c4b43bdfb0a45873c62e2c828daeb9e.tar
drakx-f541a6036c4b43bdfb0a45873c62e2c828daeb9e.tar.gz
drakx-f541a6036c4b43bdfb0a45873c62e2c828daeb9e.tar.bz2
drakx-f541a6036c4b43bdfb0a45873c62e2c828daeb9e.tar.xz
drakx-f541a6036c4b43bdfb0a45873c62e2c828daeb9e.zip
- create set_rpmsrate_category_flags(), set_rpmsrate_default_category_flags(), default_packages(), rpmsrate_always_flags() replacing setDefaultPackages()
- create select_default_packages() - apply "always" rpmsrate flags ASAP and skip packages with flag "FALSE" in computeGroupSize() => 30% speed-up
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm49
1 files changed, 24 insertions, 25 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 010ba9568..71f7832fc 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -604,35 +604,35 @@ sub read_rpmsrate_raw {
}
sub read_rpmsrate {
- my ($packages, $f) = @_;
+ my ($packages, $rpmsrate_flags_chosen, $f) = @_;
my ($rates, $flags, $need_to_copy) = read_rpmsrate_raw($f);
foreach (keys %$flags) {
my $p = packageByName($packages, $_) or next;
- my @more_flags = map { if_(/locales-(.*)/, qq(LOCALES"$1")) } $p->requires_nosense;
-
- my @flags = map {
- my $ok = 0;
- my $flag = join('||', grep {
- if (my ($inv, $p) = /^(!)?HW"(.*)"/) {
- ($inv xor detect_devices::matching_desc__regexp($p)) and $ok = 1;
- 0;
- } elsif (($inv, $p) = /^(!)?DRIVER"(.*)"/) {
- ($inv xor detect_devices::matching_driver__regexp($p)) and $ok = 1;
- 0;
- } elsif (($inv, $p) = /^(!)?TYPE"(.*)"/) {
- ($inv xor detect_devices::matching_type($p)) and $ok = 1;
- 0;
- } else {
- 1;
- }
- } split '\|\|', $_);
- $ok ? 'TRUE' : $flag || 'FALSE';
- } @{$flags->{$_}};
+ my @flags = (@{$flags->{$_}}, map { if_(/locales-(.*)/, qq(LOCALES"$1")) } $p->requires_nosense);
+
+ @flags = map {
+ my ($user_flags, $known_flags) = partition { /^!?CAT_/ } split('\|\|', $_);
+ my $ok = find {
+ my $inv = s/^!//;
+ $inv xor do {
+ if (my ($p) = /^HW"(.*)"/) {
+ detect_devices::matching_desc__regexp($p);
+ } elsif (($p) = /^DRIVER"(.*)"/) {
+ detect_devices::matching_driver__regexp($p);
+ } elsif (($p) = /^TYPE"(.*)"/) {
+ detect_devices::matching_type($p);
+ } else {
+ $rpmsrate_flags_chosen->{$_};
+ }
+ };
+ } @$known_flags;
+ $ok ? 'TRUE' : @$user_flags ? join('||', @$user_flags) : 'FALSE';
+ } @flags;
$p->set_rate($rates->{$_});
- $p->set_rflags(@flags, @more_flags);
+ $p->set_rflags(member('FALSE', @flags) ? 'FALSE' : @flags);
}
$packages->{needToCopy} = $need_to_copy;
}
@@ -747,8 +747,7 @@ sub computeGroupSize {
map { "$_&&$n" } @l;
} split('\|\|');
}
- #- HACK, remove LOCALES & CHARSET, too costly
- grep { !/LOCALES|CHARSET/ } @l;
+ @l;
}
sub or_clean {
my (@l) = map { [ sort split('&&') ] } @_ or return '';
@@ -768,7 +767,7 @@ sub computeGroupSize {
foreach my $p (@{$packages->{depslist}}) {
my @flags = $p->rflags;
- next if !$p->rate || $p->rate < $min_level;
+ next if !$p->rate || $p->rate < $min_level || @flags == 1 && $flags[0] eq 'FALSE';
my $flags = join("\t", @flags = or_ify(@flags));
$group{$p->name} = ($memo{$flags} ||= or_clean(@flags));