From d2b450a1c1b1f70802edbdf228f207239f6e20ca Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Fri, 5 Aug 2005 08:27:33 +0000 Subject: - Bug fixes in scanner::detect() function o Fixed 'grep' filter to filter out non-scanner devices by the "driver" field (in the very end of the function) o Fixed franglish in a warning message - Suppressed console message of "ls" in the scanner::resolve_symlinks() function. --- perl-install/scanner.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perl-install') diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm index fafd36d60..8660aefd3 100755 --- a/perl-install/scanner.pm +++ b/perl-install/scanner.pm @@ -284,9 +284,9 @@ sub detect { my ($device) = grep { sprintf("%04x", $_->{vendor}) eq $vendor && sprintf("%04x", $_->{id}) eq $id } @devices; if ($device) { - $driver = $device->{driver}; + $driver = $device->{driver}; } else { - warn "i failled to lookupp $vendorid && $productid"; + #warn "Failed to lookup $vendorid and $productid!\n"; } # We have vendor and product ID, look up the scanner in @@ -373,7 +373,7 @@ sub detect { @res = grep { ! $_->{configured} } @res; } # blacklist device that have a driver b/c of buggy sane-find-scanner: - return grep { member($_->{driver}, qw(scanner unknown)) } @res; + return grep { member($_->{val}{driver}, qw(scanner unknown)) } @res; } sub resolve_symlinks { @@ -391,7 +391,7 @@ sub resolve_symlinks { return $file; } while (1) { - my $ls = `ls -l $file`; + my $ls = `ls -l $file 2> /dev/null`; if ($ls =~ m!\s($file)\s*\->\s*(\S+)\s*$!) { my $target = $2; if ($target !~ m!^/! && $file =~ m!^(.*)/[^/]+$!) { -- cgit v1.2.1