From e897879fac5c75701ca4feba108fc2334db5e3d2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 15 Jan 2003 23:26:15 +0000 Subject: (find_root_parts): - do not use guess_mount_point() anymore - check /etc/mandrake-release instead of /etc/fstab - return a list of { release => "Mandrake Linux release X.X (XXXX)", part => ... } instead of a list of parts --- perl-install/install_any.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl-install/install_any.pm') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index ad759d52b..1990e891e 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -965,14 +965,17 @@ sub suggest_mount_points { $_->{mntpoint} and log::l("suggest_mount_points: $_->{device} -> $_->{mntpoint}") foreach @$fstab; } -#- mainly for finding the root partitions for upgrade sub find_root_parts { my ($fstab, $prefix) = @_; - log::l("find_root_parts"); - my $user; - grep { - my ($mnt) = guess_mount_point($_, $prefix, \$user); - $mnt eq '/'; + map { + if (my $handle = any::inspect($_, $prefix)) { + if (my $s = cat_("$handle->{dir}/etc/mandrake-release")) { + chomp($s); + $s =~ s/\s+for\s+\S+//; + log::l("find_root_parts found $_->{device}: $s"); + { release => $s, part => $_ }; + } else { () } + } else { () } } @$fstab; } sub use_root_part { -- cgit v1.2.1