diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-01 15:52:28 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-01 15:52:28 +0000 |
commit | 04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799 (patch) | |
tree | b6de61e01f2a3cf85390b811925923611709b71f /perl-install | |
parent | d01ec608b30d96d334adda5f0784045884d2011c (diff) | |
download | drakx-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar drakx-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.gz drakx-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.bz2 drakx-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.tar.xz drakx-04a52b5c3a605a93b7ec33d9b1c18ba1efb2e799.zip |
move serialPort function from mouse.pm to detect_devices.pm
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/detect_devices.pm | 7 |
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); |