summaryrefslogtreecommitdiffstats
path: root/perl-install/scanner.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-04-30 13:31:12 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-04-30 13:31:12 +0000
commit140383ca483b3d4773a7af31a94d6439dec68e4b (patch)
treea20f994d71c4955d056a4fac46153be7c74e90f0 /perl-install/scanner.pm
parentcc17bac7ba323b6a02c944d7489b01e0e0e64904 (diff)
downloaddrakx-140383ca483b3d4773a7af31a94d6439dec68e4b.tar
drakx-140383ca483b3d4773a7af31a94d6439dec68e4b.tar.gz
drakx-140383ca483b3d4773a7af31a94d6439dec68e4b.tar.bz2
drakx-140383ca483b3d4773a7af31a94d6439dec68e4b.tar.xz
drakx-140383ca483b3d4773a7af31a94d6439dec68e4b.zip
perl_checker fixes
Diffstat (limited to 'perl-install/scanner.pm')
-rwxr-xr-xperl-install/scanner.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm
index 8234ee218..e1267c600 100755
--- a/perl-install/scanner.pm
+++ b/perl-install/scanner.pm
@@ -47,9 +47,11 @@ sub confScanner {
next if $line =~ /\$VENDOR/;
$line =~ s/\$PRODUCT/$product/g if $product;
next if $line =~ /\$PRODUCT/;
- $line =~ /^(\S*)LINE\s+(.*?)$/;
- my $linetype = $1;
- $line = $2;
+ my $linetype;
+ if ($line =~ /^(\S*)LINE\s+(.*?)$/) {
+ $linetype = $1;
+ $line = $2;
+ }
next if !$line;
if (!$linetype ||
($linetype eq "USB" && ($port =~ /usb/i || $vendor)) ||
@@ -151,8 +153,7 @@ sub detect {
# SANE
next if $description =~ /Alcatel.*Speed.*Touch|Camera|ISDN|ADSL/i;
# Extract port
- $line =~ /\s+(\S+)\s*$/;
- $port = $1;
+ $port = $1 if $line =~ /\s+(\S+)\s*$/;
# Check for duplicate (scanner.o/libusb)
if ($port =~ /^libusb/) {
my $duplicate = 0;
@@ -387,8 +388,7 @@ sub updateScannerDBfromSane {
# this backend and add what is needed for the
# interfaces of this scanner
foreach my $line (@{$configlines{$backend}}) {
- $line =~ /^\s*(\S*?)LINE/;
- my $i = $1;
+ my $i = $1 if $line =~ /^\s*(\S*?)LINE/;
if (!$i || $intf =~ /$i/i) {
$to_add .= "$line\n";
}