summaryrefslogtreecommitdiffstats
path: root/perl-install/scanner.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-12-15 02:29:22 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-12-15 02:29:22 +0000
commita27a5246797ea85e9474dae5eb0af1f2a86036a2 (patch)
treecca0a721a638dab7bb4c28096e64e325f2314fac /perl-install/scanner.pm
parent02082cc6c31e10468f6fd4a26f605976c48e5502 (diff)
downloaddrakx-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar
drakx-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.gz
drakx-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.bz2
drakx-a27a5246797ea85e9474dae5eb0af1f2a86036a2.tar.xz
drakx-a27a5246797ea85e9474dae5eb0af1f2a86036a2.zip
Added facility to install scanner firmware.
Diffstat (limited to 'perl-install/scanner.pm')
-rwxr-xr-xperl-install/scanner.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm
index 34ecb01b9..85341e10c 100755
--- a/perl-install/scanner.pm
+++ b/perl-install/scanner.pm
@@ -34,7 +34,7 @@ my $scannerDBdir = "$::prefix$ENV{SHARE_PATH}/ldetect-lst";
our $scannerDB = readScannerDB("$scannerDBdir/ScannerDB");
sub confScanner {
- my ($model, $port, $vendor, $product) = @_;
+ my ($model, $port, $vendor, $product, $firmware) = @_;
$port ||= detect_devices::dev_is_devfs() ? "$::prefix/dev/usb/scanner0" : "$::prefix/dev/scanner";
my $a = $scannerDB->{$model}{server};
#print "file:[$a]\t[$model]\t[$port]\n| ", (join "\n| ", @{$scannerDB->{$model}{lines}}),"\n";
@@ -47,11 +47,13 @@ sub confScanner {
next if $line =~ /\$VENDOR/;
$line =~ s/\$PRODUCT/$product/g if $product;
next if $line =~ /\$PRODUCT/;
+ $line =~ s/\$FIRMWARE/$firmware/g if $firmware;
+ next if $line =~ /\$FIRMWARE/;
my $linetype;
if ($line =~ /^(\S*)LINE\s+(.*?)$/) {
- $linetype = $1;
- $line = $2;
- }
+ $linetype = $1;
+ $line = $2;
+ }
next if !$line;
if (!$linetype ||
($linetype eq "USB" && ($port =~ /usb/i || $vendor)) ||
@@ -60,6 +62,8 @@ sub confScanner {
($linetype eq "SCSI" && !$vendor &&
$port =~ m!(/sg|scsi|/scanner)!i)) {
handle_configs::set_directive(\@driverconf, $line, 1);
+ } elsif ($linetype eq "FIRMWARE" && $firmware) {
+ handle_configs::set_directive(\@driverconf, $line, 0);
}
}
output("$sanedir/$a.conf", @driverconf);
@@ -370,6 +374,7 @@ sub readScannerDB {
SCSILINE => sub { push @{$card->{lines}}, "SCSILINE $val" },
USBLINE => sub { push @{$card->{lines}}, "USBLINE $val" },
PARPORTLINE => sub { push @{$card->{lines}}, "PARPORTLINE $val" },
+ FIRMWARELINE => sub { push @{$card->{lines}}, "FIRMWARELINE $val" },
NAME => sub {
#$cards{$card->{type}} = $card if ($card and !$card->{flags}{unsupported});
$cards{$card->{type}} = $card if $card;