diff options
author | Francois Pons <fpons@mandriva.com> | 2001-02-23 13:58:42 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-02-23 13:58:42 +0000 |
commit | 2553df5bc745a84b74ba7b87da3ca0dc9920d6e5 (patch) | |
tree | e97a8fd70db60ec8e456ca2386fd4d1c3c72b5e5 /perl-install | |
parent | 551729b8df7afcb36a11957b968658cee65a48d9 (diff) | |
download | drakx-2553df5bc745a84b74ba7b87da3ca0dc9920d6e5.tar drakx-2553df5bc745a84b74ba7b87da3ca0dc9920d6e5.tar.gz drakx-2553df5bc745a84b74ba7b87da3ca0dc9920d6e5.tar.bz2 drakx-2553df5bc745a84b74ba7b87da3ca0dc9920d6e5.tar.xz drakx-2553df5bc745a84b74ba7b87da3ca0dc9920d6e5.zip |
added accessor the rpmsrate data of packages.
avoid rebuilding the database for oem, rpm db is assumed to be fine.
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/pkgs.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 9abab8985..cce8ea227 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -92,7 +92,9 @@ sub packageMedium { $_[0]->[$MEDIUM] } sub packageProvides { map { $_[0]->{depslist}[$_] || die "unkown package id $_" } unpack "s*", $_[1]->[$PROVIDES] } -sub packageRate { substr($_[0]->[$VALUES], 0, 1) } +sub packageRate { substr($_[0]->[$VALUES], 0, 1) } +sub packageRateRFlags { my ($rate, @flags) = split "\t", $_[0]->[$VALUES]; ($rate, @flags) } +sub packageSetRateRFlags { my ($pkg, $rate, @flags) = @_; $pkg->[$VALUES] = join("\t", $rate, @flags) } sub packageHeader { $_[0]->[$HEADER] } sub packageFreeHeader { c::headerFree(delete $_[0]->[$HEADER]) } @@ -638,7 +640,7 @@ sub read_rpmsrate { foreach (split ' ', $data) { if ($packages) { my $p = packageByName($packages, $_) or next; - $p->[$VALUES] = join("\t", $rate, grep { !/^\d$/ } @m); + packageSetRateRFlags($p, $rate, grep { !/^\d$/ } @m); } else { print "$_ = ", join(" && ", @m), "\n"; } @@ -681,8 +683,8 @@ sub setSelectedFromCompssList { my ($packages, $compssUsersChoice, $min_level, $max_size, $install_class) = @_; $compssUsersChoice->{TRUE} = 1; #- ensure TRUE is set my $nb = selectedSize($packages); - foreach my $p (sort { substr($b->[$VALUES],0,1) <=> substr($a->[$VALUES],0,1) } values %{$packages->{names}}) { - my ($rate, @flags) = split "\t", $p->[$VALUES]; + 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; #- determine the packages that will be selected when @@ -800,6 +802,9 @@ sub versionCompare($$) { sub selectPackagesAlreadyInstalled { my ($packages, $prefix) = @_; + + #- avoid rebuilding the database if such case. + $packages->{rebuild_db} = "oem does not need rebuilding the rpm db"; my $db = rebuild_db_open_for_traversal($packages, $prefix); #- this method has only one objectif, check the presence of packages |