diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-31 15:20:51 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-31 15:20:51 +0000 |
commit | 8d6c6b2529250fde353890e477acec7c3ef980e9 (patch) | |
tree | 1afe57f11dca31c4e7a58e2ab1a0d4f2dfbfff07 /perl-install/printer/detect.pm | |
parent | 98fc1310a0c85782cc06e98349fca8aa9850dc73 (diff) | |
download | drakx-backup-do-not-use-8d6c6b2529250fde353890e477acec7c3ef980e9.tar drakx-backup-do-not-use-8d6c6b2529250fde353890e477acec7c3ef980e9.tar.gz drakx-backup-do-not-use-8d6c6b2529250fde353890e477acec7c3ef980e9.tar.bz2 drakx-backup-do-not-use-8d6c6b2529250fde353890e477acec7c3ef980e9.tar.xz drakx-backup-do-not-use-8d6c6b2529250fde353890e477acec7c3ef980e9.zip |
- Fixed retrieval of parallel port base address.
Diffstat (limited to 'perl-install/printer/detect.pm')
-rw-r--r-- | perl-install/printer/detect.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 43aed0d5b..b2f3321b0 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -529,8 +529,18 @@ sub parport_addr { $device =~ m!^/dev/lp(\d+)$! or $device =~ m!^/dev/printers/(\d+)$!; my $portnumber = $1; + my $i = 0; + my $parportdir; + foreach (sort { $a =~ /(\d+)/; my $m = $1; $b =~ /(\d+)/; my $n = $1; $m <=> $n } `ls -1d /proc/parport/[0-9]* /proc/sys/dev/parport/parport[0-9]* 2>/dev/null`) { + chomp; + if ($i == $portnumber) { + $parportdir = $_; + last; + } + $i++; + } my $parport_addresses = - `cat /proc/sys/dev/parport/parport$portnumber/base-addr`; + `cat $parportdir/base-addr`; my $address_arg; if ($parport_addresses =~ /^\s*(\d+)\s+(\d+)\s*$/) { $address_arg = sprintf(" -base 0x%x -basehigh 0x%x", $1, $2); |