summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/printerdrake.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-11-13 16:27:31 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-11-13 16:27:31 +0000
commit4581ea0d90fa16fafd393a9fa31f670179b14004 (patch)
tree9cc38435aaa84665a0cc691cd88dcd489a013c02 /perl-install/printer/printerdrake.pm
parent9862f54d6821034041f629f907fdad90b1d95845 (diff)
downloaddrakx-4581ea0d90fa16fafd393a9fa31f670179b14004.tar
drakx-4581ea0d90fa16fafd393a9fa31f670179b14004.tar.gz
drakx-4581ea0d90fa16fafd393a9fa31f670179b14004.tar.bz2
drakx-4581ea0d90fa16fafd393a9fa31f670179b14004.tar.xz
drakx-4581ea0d90fa16fafd393a9fa31f670179b14004.zip
- final switch to $::prefix
- simplify main::get_copiable_queues(), main::setcupslink() - s/unless (X ne Y)/if (X eq Y)/ - set_usermode() : ensure we add the line if it didn't exists
Diffstat (limited to 'perl-install/printer/printerdrake.pm')
-rw-r--r--perl-install/printer/printerdrake.pm24
1 files changed, 7 insertions, 17 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index c4ef448c1..225d9a0bd 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -1,8 +1,7 @@
package printer::printerdrake;
# $Id$
-
-
+use strict;
use common;
use detect_devices;
@@ -40,11 +39,7 @@ Printers on remote CUPS servers you do not have to configure here; these printer
type => 'bool', val => \$autodetect }
]
) or return 0;
- if ($autodetect) {
- $printer->{AUTODETECT} = 1;
- } else {
- undef $printer->{AUTODETECT};
- }
+ $printer->{AUTODETECT} = $autodetect ? 1 : undef;
$printer->{TYPE} = $printer::printer_type{$printer->{str_type}};
1;
}
@@ -472,7 +467,7 @@ sub setup_local_autoscan {
my $second = $menuentries->{$b};
for (my $i = 0; $i <= $#prefixes; $i++) {
my $firstinlist = ($first =~ m!^$prefixes[$i]!);
- my $secondinlist = ($second =~ m!^$prefixes[$i]!);
+ my $secondinlist = ($second =~ m!^$::prefixes[$i]!);
if (($firstinlist) && (!$secondinlist)) { return -1 };
if (($secondinlist) && (!$firstinlist)) { return 1 };
}
@@ -546,16 +541,14 @@ sub setup_local_autoscan {
N("No local printer found! To manually install a printer enter a device name/file name in the input line (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1st USB printer: /dev/usb/lp0, 2nd USB printer: /dev/usb/lp1, ...)."),
{
complete => sub {
- unless ($menuchoice ne "") {
+ if ($menuchoice eq "") {
$in->ask_warn('', N("You must enter a device or file name!"));
return (1,0);
}
return 0;
}
});
- if ($device eq "") {
- return 0;
- }
+ return 0 if $device eq "";
} else {
$in->ask_warn(N("Printer auto-detection"),
N("No printer found!"));
@@ -615,11 +608,7 @@ sub setup_local_autoscan {
$menuchoice = "";
$do_auto_detect = 0;
}
- if ($manualconf) {
- $printer->{MANUAL} = 1;
- } else {
- undef $printer->{MANUAL};
- }
+ $printer->{MANUAL} = $manualconf ? 1 : undef;
}
}
@@ -2681,6 +2670,7 @@ Do you want to have the automatic starting of the printing system turned on agai
1;
}
+# FIXME: heavy duplication
sub install_spooler {
# installs the default spooler and start its daemon
my ($printer, $in, $upNetwork) = @_;