summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-02 15:39:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-02 15:39:15 +0000
commitb8a0b61228f4086bedb20590d65b5d2060e2565b (patch)
tree907eeb08722855c99b29aabdc665c5051e080a9b /perl-install/install_any.pm
parent81ea6be5a28c7575227cd5658947246261f9ffa4 (diff)
downloaddrakx-b8a0b61228f4086bedb20590d65b5d2060e2565b.tar
drakx-b8a0b61228f4086bedb20590d65b5d2060e2565b.tar.gz
drakx-b8a0b61228f4086bedb20590d65b5d2060e2565b.tar.bz2
drakx-b8a0b61228f4086bedb20590d65b5d2060e2565b.tar.xz
drakx-b8a0b61228f4086bedb20590d65b5d2060e2565b.zip
- new functionality: upgrade_by_removing_pkgs, enabled when upgrading redhat and conectiva distributions
- add file upgrade-map.conectiva.10 for precise choice of packages - save /etc/xxx-release into /root/drakx/xxx-release.upgrading when starting - release_file(): look for xxx-release.upgrading first - find_root_parts(): better logging about upgrade_by_removing_pkgs, and factorize code - when all packages are installed, remove xxx-release.upgrading and rename pkgs::removed_pkgs_to_upgrade_file()
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 5f73d4a62..f14b3cf35 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -643,6 +643,11 @@ sub setPackages {
#- open rpm db according to right mode needed (ie rebuilding database if upgrading)
$o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{isUpgrade});
+ if (my $extension = $o->{upgrade_by_removing_pkgs_matching}) {
+ $wait_message->(N("Removing packages prior to upgrade..."));
+ push @{$o->{default_packages}}, pkgs::upgrade_by_removing_pkgs($o->{packages}, \&install_steps::installCallback, $extension, "$ENV{SHARE_PATH}/upgrade-map.$o->{isUpgrade}");
+ }
+
#- always try to select basic kernel (else on upgrade, kernel will never be updated provided a kernel is already
#- installed and provides what is necessary).
pkgs::selectPackage($o->{packages},
@@ -1505,20 +1510,23 @@ sub suggest_mount_points {
sub find_root_parts {
my ($fstab, $prefix) = @_;
+ my $extract = sub {
+ my ($prefix, $f, $part) = @_;
+ chomp(my $s = cat_("$prefix$f"));
+ $s =~ s/\s+for\s+\S+//;
+ log::l("find_root_parts found $part->{device}: $s" . ($f !~ m!/etc/! ? " in special release file $f" : ''));
+ { release => $s, release_file => $f, part => $part };
+ };
+
if ($::local_install) {
my $f = common::release_file('/mnt') or return;
- chomp(my $s = cat_("/mnt$f"));
- $s =~ s/\s+for\s+\S+//;
- return { release => $s, release_file => $f };
+ return $extract->('/mnt', $f, {});
}
map {
my $handle = any::inspect($_, $prefix);
if (my $f = $handle && common::release_file($handle->{dir})) {
- chomp(my $s = cat_("$handle->{dir}$f"));
- $s =~ s/\s+for\s+\S+//;
- log::l("find_root_parts found $_->{device}: $s");
- { release => $s, part => $_, release_file => $f };
+ $extract->($handle->{dir}, $f, $_);
} else { () }
} @$fstab;
}