summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-08-20 16:48:20 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-08-20 16:48:20 +0000
commit899f293944ef786470f73e7497da3453313cb320 (patch)
tree8f9f475229b73d1e030768a584b6236e5b32359d
parent94ff48665088c56406cc3d6b0de8a0cb08fe3d6c (diff)
downloaddrakx-backup-do-not-use-899f293944ef786470f73e7497da3453313cb320.tar
drakx-backup-do-not-use-899f293944ef786470f73e7497da3453313cb320.tar.gz
drakx-backup-do-not-use-899f293944ef786470f73e7497da3453313cb320.tar.bz2
drakx-backup-do-not-use-899f293944ef786470f73e7497da3453313cb320.tar.xz
drakx-backup-do-not-use-899f293944ef786470f73e7497da3453313cb320.zip
- Let all occurences of "Seiko Epson" replaced by "Epson" both in the
scanner names read from the ScannerDB and in the names resulting from scanner auto-detection (names from usbtable). So the user gets presented "Epson" and usbtable can have "Epson" names where ScannerDB can have "Seiko Epson" names. - If a scanner is listed as "unsupported" in ScannerDB, the user gets a message instead of scannerdrake silently exiting.
-rwxr-xr-xperl-install/scanner.pm7
-rwxr-xr-xperl-install/standalone/scannerdrake14
2 files changed, 19 insertions, 2 deletions
diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm
index b3a4a8a52..d8716c84d 100755
--- a/perl-install/scanner.pm
+++ b/perl-install/scanner.pm
@@ -56,6 +56,7 @@ sub detect {
foreach (grep { $_->{driver} =~ /scanner/ } detect_devices::usb_probe()) {
#my ($manufacturer, $model) = split '\|', $_->{description};
#$_->{description} =~ s/Hewlett[-\s_]Packard/HP/;
+ $_->{description} =~ s/Seiko\s+Epson/Epson/i;
push @res, { port => "/dev/usb/scanner$i", val => { #CLASS => 'SCANNER',
#MODEL => $model,
#MANUFACTURER => $manufacturer,
@@ -66,6 +67,7 @@ sub detect {
++$i;
}
foreach (grep { $_->{media_type} =~ /scanner/ } detect_devices::getSCSI()) {
+ $_->{info} =~ s/Seiko\s+Epson/Epson/i;
push @res, { port => "/dev/sg",
val => { DESCRIPTION => $_->{info} },
};
@@ -85,10 +87,13 @@ sub readScannerDB {
my $fs = {
LINE => sub { push @{$card->{lines}}, $val },
NAME => sub {
- $cards{$card->{type}} = $card if ($card and !$card->{flags}{unsupported});
+ #$cards{$card->{type}} = $card if ($card and !$card->{flags}{unsupported});
+ $cards{$card->{type}} = $card if ($card);
+ $val =~ s/Seiko\s+Epson/Epson/i;
$card = { type => $val };
},
SEE => sub {
+ $val =~ s/Seiko\s+Epson/Epson/i;
my $c = $cards{$val} or die "Error in database, invalid reference $val at line $lineno";
push @{$card->{lines}}, @{$c->{lines} || []};
diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake
index 5a8c7066c..4ce8c5add 100755
--- a/perl-install/standalone/scannerdrake
+++ b/perl-install/standalone/scannerdrake
@@ -49,6 +49,10 @@ sub auto {
if (member($_->{val}{DESCRIPTION}, keys %$scanner::scannerDB)) {
my $name = $_->{val}{DESCRIPTION};
$name =~ s/\s$//; #some HP entry have a trailing space, i will correct usbtable asap
+ if ($scanner::scannerDB->{$name}{flags}{unsupported}) {
+ $in->ask_warn('scannerdrake', _("The %s is not supported by this version of Mandrake Linux.", $name));
+ return;
+ }
$in->ask_yesorno('scannerdrake',_("%s found on %s, configure it?",$name,$_->{port}),1) or manual();
tryConfScanner($name, $_->{port});
} else {
@@ -60,15 +64,23 @@ sub auto {
sub manual {
my $s = $in->ask_from_treelist('scannerdrake', _("Select a scanner"), '|', [' None', keys %$scanner::scannerDB], '') or return;
return if $s eq ' None';
+ if ($scanner::scannerDB->{$s}{flags}{unsupported}) {
+ $in->ask_warn('scannerdrake', _("The %s is not supported by this version of Mandrake Linux.", $s));
+ return;
+ }
tryConfScanner($s);
}
sub dynamic {
@f = scanner::detect();
foreach (@f) {
- if (member($_->{val}{DESCRIPTION}), keys %$scanner::scannerDB) {
+ if (member($_->{val}{DESCRIPTION}, keys %$scanner::scannerDB)) {
my $name = $_->{val}{DESCRIPTION};
$name =~ s/\s$//; #some HP entry have a trailing space, i will correct usbtable asap
+ if ($scanner::scannerDB->{$name}{flags}{unsupported}) {
+ $in->ask_warn('scannerdrake', _("The %s is not supported by this version of Mandrake Linux.", $name));
+ return;
+ }
scanner::confScanner($name, $_->{port}) unless ($scanner::scannerDB->{$model}{flags}{unsupported});
}
}