summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-16 19:58:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-16 19:58:22 +0000
commitf7d35b5e13d69f57e2713ffab1129092287c5e73 (patch)
treeb767b577cd7efb25f1f247da0a11ce165b075982 /perl-install/pkgs.pm
parent425c0ea4e94fa0ecabd6a6829fdbb8c9bef52774 (diff)
downloaddrakx-f7d35b5e13d69f57e2713ffab1129092287c5e73.tar
drakx-f7d35b5e13d69f57e2713ffab1129092287c5e73.tar.gz
drakx-f7d35b5e13d69f57e2713ffab1129092287c5e73.tar.bz2
drakx-f7d35b5e13d69f57e2713ffab1129092287c5e73.tar.xz
drakx-f7d35b5e13d69f57e2713ffab1129092287c5e73.zip
- cleanup packages appearing twice in rpmsrate
- handle a few case of packages appearing twice - special case for packages appearing in INSTALL section (flag dropped) - new special flag ALL for compssUsersChoice
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 3b14e298b..14e0ff633 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -583,6 +583,7 @@ sub getProvides($) {
sub read_rpmsrate {
my ($packages, $f) = @_;
my $line_nb = 0;
+ my $fatal_error;
my (@l);
while (<$f>) {
$line_nb++;
@@ -630,7 +631,21 @@ sub read_rpmsrate {
my @m2 =
map { if_($_ && packageName($_) =~ /locales-(.*)/, qq(LOCALES"$1")) }
map { packageById($packages, $_) } packageDepsId($p);
- packageSetRateRFlags($p, $rate, (grep { !/^\d$/ } @m), @m2);
+
+ @m = ((grep { !/^\d$/ } @m), @m2);
+ if (packageRate($p)) {
+ next if @m == 1 && $m[0] eq 'INSTALL';
+
+ my ($rate2, @m3) = packageRateRFlags($p);
+ if (@m3 > 1 || @m > 1) {
+ log::l("can't handle complicate flags for packages appearing twice ($_)");
+ $fatal_error++;
+ }
+ log::l("package $_ appearing twice with different rates ($rate != $rate2)") if $rate != $rate2;
+ packageSetRateRFlags($p, $rate, "$m[0]||$m3[0]");
+ } else {
+ packageSetRateRFlags($p, $rate, @m);
+ }
} else {
print "$_ = ", join(" && ", @m), "\n";
}
@@ -640,6 +655,7 @@ sub read_rpmsrate {
push @l, [ $l2[0][0], $l2[$#l2][1] ];
}
}
+ $fatal_error and die "$fatal_error fatal errors in rpmsrate";
}
sub readCompssUsers {
@@ -690,7 +706,9 @@ sub setSelectedFromCompssList {
my $nb = selectedSize($packages);
foreach my $p (sort { packageRate($b) <=> packageRate($a) } values %{$packages->{names}}) {
my ($rate, @flags) = packageRateRFlags($p);
- next if !$rate || $rate < $min_level || grep { !grep { /^!(.*)/ ? !$compssUsersChoice->{$1} : $compssUsersChoice->{$_} } split('\|\|') } @flags;
+ next if
+ !$rate || $rate < $min_level ||
+ !$compssUsersChoice->{ALL} && grep { !grep { /^!(.*)/ ? !$compssUsersChoice->{$1} : $compssUsersChoice->{$_} } split('\|\|') } @flags;
#- determine the packages that will be selected when
#- selecting $p. the packages are not selected.