diff options
author | Francois Pons <fpons@mandriva.com> | 2000-05-05 18:45:23 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2000-05-05 18:45:23 +0000 |
commit | 969bc065596476bce5cfed0bb7ffd263f48eb1d5 (patch) | |
tree | 8f890d39f7b1ccfa6dbeb8f7cc3281748ee30f46 /perl-install/pkgs.pm | |
parent | 8255a2010a0698471fb35f42b1ebcad3462f153a (diff) | |
download | drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.gz drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.bz2 drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.tar.xz drakx-969bc065596476bce5cfed0bb7ffd263f48eb1d5.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 8c4761872..844b5ec4f 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -177,7 +177,7 @@ sub invCorrectSize { min($_[0], (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 sub selectedSize { my ($packages) = @_; - int (sum map { packageSize($_) } grep { packageFlagSelected($_) } values %{$packages->[0]}); + int (sum map { packageSize($_) - ($_->{installedCumulSize} || 0) } grep { packageFlagSelected($_) } values %{$packages->[0]}); } sub correctedSelectedSize { correctSize(selectedSize($_[0]) / sqr(1024)) } @@ -703,10 +703,22 @@ sub selectPackagesToUpgrade($$$;$$) { #- used for package that are not correctly updated. #- should only be used when nothing else can be done correctly. my %upgradeNeedRemove = ( -# 'compat-glibc' => 1, -# 'compat-libs' => 1, + 'libstdc++' => 1, + 'compat-glibc' => 1, + 'compat-libs' => 1, ); + #- these package are not named as ours, need to be translated before working. + #- a version may follow to setup a constraint 'installed version greater than'. + my %otherPackageToRename = ( + 'qt' => [ 'qt2', '2.0' ], + 'qt1x' => [ 'qt' ], + ); + #- generel purpose for forcing upgrade of package whatever version is. + my %packageNeedUpgrade = ( + 'lilo' => 1, #- this package has been misnamed in 7.0. + ); + #- help removing package which may have different release numbering my %toRemove; map { $toRemove{$_} = 1 } @{$toRemove || []}; @@ -715,11 +727,17 @@ sub selectPackagesToUpgrade($$$;$$) { #- the 'installed' property will make a package unable to be selected, look at select. c::rpmdbTraverse($db, sub { my ($header) = @_; - my $p = $packages->[0]{c::headerGetEntry($header, 'name')}; my $otherPackage = (c::headerGetEntry($header, 'release') !~ /mdk\w*$/ && (c::headerGetEntry($header, 'name'). '-' . c::headerGetEntry($header, 'version'). '-' . c::headerGetEntry($header, 'release'))); + my $renaming = $otherPackage && $otherPackageToRename{c::headerGetEntry($header, 'name')}; + my $name = $renaming && + (!$renaming->[1] || versionCompare(c::headerGetEntry($header, 'version'), $renaming->[1]) >= 0) && + $renaming->[0]; + $name and $packageNeedUpgrade{$name} = 1; #- keep in mind to force upgrading this package. + my $p = $packages->[0]{$name || c::headerGetEntry($header, 'name')}; + if ($p) { my $version_cmp = versionCompare(c::headerGetEntry($header, 'version'), packageVersion($p)); my $version_rel_test = $version_cmp > 0 || $version_cmp == 0 && @@ -756,6 +774,9 @@ sub selectPackagesToUpgrade($$$;$$) { #- skip if not installed (package not found in current install). $skipThis ||= ($count == 0); + #- make sure to upgrade package that have to be upgraded. + $packageNeedUpgrade{packageName($p)} and $skipThis = 0; + #- select the package if it is already installed with a lower version or simply not installed. unless ($skipThis) { my $cumulSize; |