diff options
-rw-r--r-- | perl-install/harddrake/data.pm | 2 | ||||
-rwxr-xr-x | perl-install/scanner.pm | 12 | ||||
-rwxr-xr-x | perl-install/standalone/scannerdrake | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/perl-install/harddrake/data.pm b/perl-install/harddrake/data.pm index d7eb38011..4cd4e957e 100644 --- a/perl-install/harddrake/data.pm +++ b/perl-install/harddrake/data.pm @@ -63,7 +63,7 @@ our @tree = require printerdrake; printerdrake::auto_detect(class_discard->new) } ], ["SCANNER","Scanner", "scanner.png", "$sbindir/scannerdrake", sub { - require scanner; scanner::findScannerUsbport() }], + require scanner; scanner::detect() }], ["MOUSE","Mouse", "hw_mouse.png", "$sbindir/mousedrake", sub { require mouse; &mouse::detect() } ], ["JOYSTICK","Joystick", "joystick.png", "", sub {}], diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm index 995a2f2e4..1bc381c9d 100755 --- a/perl-install/scanner.pm +++ b/perl-install/scanner.pm @@ -51,7 +51,7 @@ sub add2dll { close F; } -sub findScannerUsbport { +sub detect { my ($i, $elem, @res) = (0, {}); foreach (grep { $_->{driver} =~ /scanner/ } detect_devices::usb_probe()) { #my ($manufacturer, $model) = split '\|', $_->{description}; @@ -65,14 +65,16 @@ sub findScannerUsbport { }}; ++$i; } + foreach ({$_->{media_type} =~ /scanner/ } detect_devices::getSCSI()) { + push @res, { port => "/dev/usb/scanner$i", + val => { DESCRIPTION => $_->{info} }, + }; + ++$i; + } @res; } -sub findScannerScsi { - -} - sub readScannerDB { my ($file) = @_; my ($card, %cards); diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake index 1f6242987..f7406e332 100755 --- a/perl-install/standalone/scannerdrake +++ b/perl-install/standalone/scannerdrake @@ -39,7 +39,7 @@ $in = 'interactive'->vnew('su', 'default'); $in->do_pkgs->install('sane-backends', 'xsane', if_($in->do_pkgs->is_installed('gimp'),'xsane-gimp')); if ($::Manual) { manual(); quit() } my $wait = $in->wait_message(_("Test ports"), _("Detecting devices ...")); -@f = scanner::findScannerUsbport(); +@f = scanner::detect(); $wait=undef; (@f) ? auto() : manual(); quit(); @@ -62,7 +62,7 @@ sub manual { } sub dynamic { - @f = scanner::findScannerUsbport(); + @f = scanner::detect(); foreach (@f) { if (member($_->{val}{DESCRIPTION}), keys %$scanner::scannerDB) { my $name = $_->{val}{DESCRIPTION}; |