From 81dcd71c5587aeb713861f4efba3b8250c8df685 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Thu, 23 Nov 2000 18:17:15 +0000 Subject: synced versionCompare() with rpmtools-2.1-4mdk. removed ugly log on transaction. added special case to avoid counting kernels space when upgrading as these package are not upgraded (just installed). --- perl-install/pkgs.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index af343b281..eb0b5323a 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -826,7 +826,7 @@ sub versionCompare($$) { local $_; while ($a || $b) { - my ($sb, $sa) = map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D+)// } ($b, $a); + my ($sb, $sa) = map { $1 if ($a || 0) =~ /^\W*\d/ ? s/^\W*0*(\d+)// : s/^\W*(\D+)// } ($b, $a); $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_; } } @@ -1038,8 +1038,10 @@ sub selectPackagesToUpgrade($$$;$$) { }); #- keep in mind the cumul size of installed package since they will be deleted - #- on upgrade. - print UPGRADE_OUTPUT "$cumulSize:" . packageName($p) . "\n"; + #- on upgrade, only for package that are allowed to be upgraded. + if (allowedToUpgrade(packageName($p))) { + print UPGRADE_OUTPUT "$cumulSize:" . packageName($p) . "\n"; + } } } @@ -1163,8 +1165,8 @@ sub selectPackagesToUpgrade($$$;$$) { sub allowedToUpgrade { $_[0] !~ /^(kernel|kernel-secure|kernel-smp|kernel-linus|hackkernel)$/ } sub installCallback { - my $msg = shift; - log::l($msg .": ". join(',', @_)); +# my $msg = shift; +# log::l($msg .": ". join(',', @_)); } sub install($$$;$$) { -- cgit v1.2.1