From e94ae685f0dea15ec01eabfb18e671eb1a4ecb9e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 28 Aug 2002 18:08:03 +0000 Subject: create detect_devices::suggest_mount_point and use it instead of doing it in fs::set_removable_mntpoints --- perl-install/detect_devices.pm | 16 ++++++++++++++++ perl-install/fs.pm | 19 ++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index e8b728b6e..8c647bdb3 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -681,4 +681,20 @@ sub is_a_recent_computer { $frequence > 600; } +sub suggest_mount_point { + my ($e) = @_; + + my $name = $e->{media_type}; + if (member($name, 'hd', 'fd')) { + if (isZipDrive($e)) { + $name = 'zip'; + } elsif ($name eq 'fd') { + $name = 'floppy'; + } else { + log::l("set_removable_mntpoints: don't know what to with hd $e->{device}"); + } + } + $name; +} + 1; diff --git a/perl-install/fs.pm b/perl-install/fs.pm index d1d6887d7..f50418ede 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -503,21 +503,10 @@ sub set_removable_mntpoints { my %names; foreach (@{$all_hds->{raw_hds}}) { - my $name = $_->{media_type}; - if (member($name, 'hd', 'fd')) { - if (detect_devices::isZipDrive($_)) { - $name = 'zip'; - } elsif ($name eq 'fd') { - $name = 'floppy'; - } else { - log::l("set_removable_mntpoints: don't know what to with hd $_->{device}"); - next; - } - } - if ($name) { - my $s = ++$names{$name}; - $_->{mntpoint} ||= "/mnt/$name" . ($s == 1 ? '' : $s); - } + my $name = detect_devices::suggest_mount_point($_) or next; + + my $s = ++$names{$name}; + $_->{mntpoint} ||= "/mnt/$name" . ($s == 1 ? '' : $s); } } -- cgit v1.2.1