summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/scanner.pm14
-rwxr-xr-xperl-install/standalone/scannerdrake9
2 files changed, 18 insertions, 5 deletions
diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm
index c73057d91..819ae84e2 100755
--- a/perl-install/scanner.pm
+++ b/perl-install/scanner.pm
@@ -87,7 +87,7 @@ sub setfirmware {
sub installfirmware {
# Install the firmware file in /usr/share/sane/firmware
- my ($firmware) = @_;
+ my ($firmware, $backend) = @_;
return "" if !$firmware;
# Install firmware
run_program::rooted($::prefix, "mkdir", "-p",
@@ -96,6 +96,18 @@ sub installfirmware {
N("Could not create directory /usr/share/sane/firmware!"));
return "";
};
+ # Link /usr/share/sane/firmware to /usr/share/sane/<backend name> as
+ # some backends ignore the supplied absolute path to the firmware file
+ # and always search their own directory
+ if ($backend) {
+ run_program::rooted($::prefix, "ln", "-sf",
+ "/usr/share/sane/firmware",
+ "/usr/share/sane/$backend") || do {
+ $in->ask_warn('Scannerdrake',
+ N("Could not create link /usr/share/sane/%s!", $backend));
+ return "";
+ };
+ }
run_program::rooted($::prefix, "cp", "-f", "$firmware",
"/usr/share/sane/firmware") || do {
$in->ask_warn('Scannerdrake',
diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake
index adc167bc2..3ddedfe14 100755
--- a/perl-install/standalone/scannerdrake
+++ b/perl-install/standalone/scannerdrake
@@ -165,7 +165,7 @@ sub dynamic() {
}
sub installfirmware {
- my ($model) = @_;
+ my ($model, $backend) = @_;
my $firmware;
my $choice = N("Do not install firmware file");
while (1) {
@@ -204,7 +204,7 @@ sub installfirmware {
}
# Install the firmware file in /usr/share/sane/firmware
- $firmware = scanner::installfirmware($firmware);
+ $firmware = scanner::installfirmware($firmware, $backend);
return $firmware;
}
@@ -266,7 +266,7 @@ sub updatefirmware {
return 0 if !$firmware;
# Install the firmware file in /usr/share/sane/firmware
- $firmware = scanner::installfirmware($firmware);
+ $firmware = scanner::installfirmware($firmware, $_->{val}{BACKEND});
# Enter the path to the firmware in the appropriate config file
foreach (@configured) {
@@ -367,7 +367,8 @@ sub tryConfScanner {
($vendor, $product) = scanner::get_usb_ids_for_port($port);
my $firmware;
if (grep { /FIRMWARELINE/ } @{$scanner::scannerDB->{$model}{lines}} ) {
- $firmware = installfirmware($model);
+ $firmware = installfirmware($model,
+ $scanner::scannerDB->{$model}{server});
return 0 if $firmware eq "///";
}
scanner::confScanner($model, $port, $vendor, $product, $firmware);