summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-07-01 15:52:28 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-07-01 15:52:28 +0000
commit04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799 (patch)
treeb6de61e01f2a3cf85390b811925923611709b71f
parentd01ec608b30d96d334adda5f0784045884d2011c (diff)
downloaddrakx-backup-do-not-use-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar
drakx-backup-do-not-use-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.gz
drakx-backup-do-not-use-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.bz2
drakx-backup-do-not-use-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.xz
drakx-backup-do-not-use-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.zip
move serialPort function from mouse.pm to detect_devices.pm
-rw-r--r--perl-install/detect_devices.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 02dd6ef4f..251bf4fe4 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -544,6 +544,11 @@ sub getInputDevices_and_usb() {
@l;
}
+sub serialPorts() { map { "ttyS$_" } 0..7 }
+sub serialPort2text {
+ $_[0] =~ /ttyS(\d+)/ ? "$_[0] / COM" . ($1 + 1) : $_[0];
+}
+
sub getSerialModem {
my ($modules_conf, $o_mouse) = @_;
my $mouse = $o_mouse || {};
@@ -554,7 +559,7 @@ sub getSerialModem {
my @modems;
probeSerialDevices();
- foreach my $port (map { "ttyS$_" } (0..7)) {
+ foreach my $port (serialPorts()) {
next if $mouse->{device} =~ /$port/;
my $device = "/dev/$port";
next if !-e $device || !hasModem($device);