summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-18 16:44:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-18 16:44:52 +0000
commite9746d5b1868e7ecdbabce94c47325e05c2f666d (patch)
tree0c1d2ca28c1c3c7fbddb81d4b3d29572895bded7 /perl-install/printer
parentc7a67d1bcbcffaadbbb06be8f11e78e7508eed02 (diff)
downloaddrakx-e9746d5b1868e7ecdbabce94c47325e05c2f666d.tar
drakx-e9746d5b1868e7ecdbabce94c47325e05c2f666d.tar.gz
drakx-e9746d5b1868e7ecdbabce94c47325e05c2f666d.tar.bz2
drakx-e9746d5b1868e7ecdbabce94c47325e05c2f666d.tar.xz
drakx-e9746d5b1868e7ecdbabce94c47325e05c2f666d.zip
make perl_checker happy
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/detect.pm2
-rw-r--r--perl-install/printer/gimp.pm10
-rw-r--r--perl-install/printer/main.pm4
-rw-r--r--perl-install/printer/office.pm6
-rw-r--r--perl-install/printer/printerdrake.pm43
5 files changed, 32 insertions, 33 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm
index 6aa03db11..57d151746 100644
--- a/perl-install/printer/detect.pm
+++ b/perl-install/printer/detect.pm
@@ -125,7 +125,7 @@ sub getIPsInLocalNetworks {
# ... for a local network (eth = ethernet,
# vmnet = VMWare,
# ethernet card connected to ISP excluded)?
- $dev_is_localnet = ($dev =~ /^eth/ || $dev =~ /^vmnet/);
+ $dev_is_localnet = $dev =~ /^eth/ || $dev =~ /^vmnet/;
# delete previous address
$current_bcast = "";
}
diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm
index c292e583c..c6d7a08d0 100644
--- a/perl-install/printer/gimp.pm
+++ b/perl-install/printer/gimp.pm
@@ -80,7 +80,7 @@ sub addcupsremoteto {
my @printerlist = printer::cups::get_remote_queues();
my $ppdfile = "";
if ($printer->{SPOOLER} eq "cups" &&
- ((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
+ (-x "$::prefix/usr/bin/curl" || -x "$::prefix/usr/bin/wget")) {
foreach my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
my $q = $1;
@@ -100,7 +100,7 @@ sub addcupsremoteto {
"http://$server:631/printers/$q.ppd"));
}
# Does the file exist and is it not an error message?
- if ((-r "$::prefix/etc/foomatic/$queue.ppd") &&
+ if (-r "$::prefix/etc/foomatic/$queue.ppd" &&
cat_("$::prefix/etc/foomatic/$queue.ppd") =~ /^\*PPD-Adobe/) {
$ppdfile = "/etc/foomatic/$queue.ppd";
} else {
@@ -227,7 +227,7 @@ sub findconfigfiles {
foreach my $file (@configfilenames) {
my $dir = "$homedir/$file";
$dir =~ s,/[^/]*$,,;
- next if (-f $dir) && ! -d $dir;
+ next if -f $dir && ! -d $dir;
if (! -d "$::prefix$dir") {
mkdir_p("$::prefix$dir") or next;
set_permissions("$::prefix$dir", "$uid.$gid") or next;
@@ -362,11 +362,11 @@ sub isprinterconfigured {
if (/^\s*Printer\s*:\s*.*\s*$/) { # Next section
$done = 1;
} elsif (/^\s*Driver:\s*(\S+)\s*$/) {
- $drivernotps2 = ($1 ne "ps2");
+ $drivernotps2 = $1 ne "ps2";
} elsif (/^\s*PPD\-File:\s*(\S+)\s*$/) {
$ppdfileset = 1;
} elsif (/^\s*Destination:\s*(\S+.*)$/) {
- $nonrawprinting = ($1 !~ /\-o\s*raw/);
+ $nonrawprinting = $1 !~ /\-o\s*raw/;
}
}
}
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index f9e712aa9..c00bf1135 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -50,7 +50,7 @@ sub spooler {
# LPRng is not officially supported any more since Mandrake 9.0, so
# show it only in the spooler menu when it was manually installed.
my @res;
- if (files_exist((qw(/usr/lib/filters/lpf /usr/sbin/lpd)))) {
+ if (files_exist(qw(/usr/lib/filters/lpf /usr/sbin/lpd))) {
foreach (qw(cups lprng pdq)) { push @res, $spooler_inv{$_}{long_name} };
# {qw(cups lprng pdq)}{long_name};
} else {
@@ -982,7 +982,7 @@ sub configure_queue($) {
$useUSB ||= $_->{queuedata}{connect} =~ /usb/ ||
$_->{DeviceURI} =~ /usb/;
}
- $useUSB ||= ($printer->{currentqueue}{queue}{queuedata}{connect} =~ /usb/);
+ $useUSB ||= $printer->{currentqueue}{queue}{queuedata}{connect} =~ /usb/;
if ($useUSB) {
my $f = "$::prefix/etc/sysconfig/usb";
my %usb = getVarsFromSh($f);
diff --git a/perl-install/printer/office.pm b/perl-install/printer/office.pm
index a933fca29..2498bcabe 100644
--- a/perl-install/printer/office.pm
+++ b/perl-install/printer/office.pm
@@ -48,7 +48,7 @@ sub configureoffice {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if (0 && $printer->{SPOOLER} eq "cups" &&
- ((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
+ (-x "$::prefix/usr/bin/curl" || -x "$::prefix/usr/bin/wget")) {
my @printerlist = printer::cups::get_remote_queues();
foreach my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
@@ -114,7 +114,7 @@ sub add_cups_remote_to_office {
my $configfilecontent = readsofficeconfigfile($configfilename);
# Update remote CUPS queues
if ($printer->{SPOOLER} eq "cups" &&
- ((-x "$::prefix/usr/bin/curl") || (-x "$::prefix/usr/bin/wget"))) {
+ (-x "$::prefix/usr/bin/curl" || -x "$::prefix/usr/bin/wget")) {
my @printerlist = printer::cups::get_remote_queues();
foreach my $listentry (@printerlist) {
next if !($listentry =~ /^([^\|]+)\|([^\|]+)$/);
@@ -135,7 +135,7 @@ sub add_cups_remote_to_office {
"http://$server:631/printers/$q.ppd"));
}
# Does the file exist and is it not an error message?
- if ((-r "$::prefix/etc/foomatic/$queue.ppd") &&
+ if (-r "$::prefix/etc/foomatic/$queue.ppd" &&
cat_("$::prefix/etc/foomatic/$queue.ppd") =~ /^\*PPD-Adobe/) {
$configfilecontent =
$suites{$suite}{make}($printer, $queue,
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index 9dd38d532..43fa9d5b5 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -174,7 +174,7 @@ sub first_time_dialog {
my $entry = $printer->{val}{DESCRIPTION};
if ($entry) { push (@printerlist, " - $entry\n") }
}
- my $morethanoneprinters = ($#printerlist > 0);
+ my $morethanoneprinters = $#printerlist > 0;
my $unknown_printers = $#autodetected - $#printerlist;
if (@printerlist != ()) {
unshift (@printerlist,
@@ -210,8 +210,8 @@ sub first_time_dialog {
# If networking is configured, start it, but don't ask the user to
# configure networking.
my $havelocalnetworks =
- (check_network($printer, $in, $upNetwork, 1) &&
- printer::detect::getIPsInLocalNetworks() != ());
+ check_network($printer, $in, $upNetwork, 1) &&
+ printer::detect::getIPsInLocalNetworks() != ();
# Finish building the dialog text
my $question = ($havelocalnetworks ?
@@ -245,8 +245,8 @@ sub wizard_welcome {
undef $printer->{AUTODETECTNETWORK};
undef $printer->{AUTODETECTSMB};
} else {
- $havelocalnetworks = (check_network($printer, $in, $upNetwork, 1) &&
- printer::detect::getIPsInLocalNetworks() != ());
+ $havelocalnetworks = check_network($printer, $in, $upNetwork, 1) &&
+ printer::detect::getIPsInLocalNetworks() != ();
if (!$havelocalnetworks) {
undef $printer->{AUTODETECTNETWORK};
undef $printer->{AUTODETECTSMB};
@@ -344,7 +344,7 @@ sub setup_local_autoscan {
my ($printer, $in, $upNetwork) = @_;
my (@port, @str, $device);
my $queue = $printer->{OLD_QUEUE};
- my $expert_or_modify = ($::expert || !$printer->{NEW});
+ my $expert_or_modify = $::expert || !$printer->{NEW};
my $do_auto_detect =
($expert_or_modify &&
$printer->{AUTODETECT} ||
@@ -373,12 +373,12 @@ sub setup_local_autoscan {
# configured, this command has no effect.
require services;
services::stop("hpoj");
- @autodetected = ($expert_or_modify || $printer->{AUTODETECTLOCAL}) and printer::detect::local_detect(),
+ @autodetected = $expert_or_modify || $printer->{AUTODETECTLOCAL} and printer::detect::local_detect(),
(!$expert_or_modify && $printer->{AUTODETECTNETWORK}) and printer::detect::net_detect(),
(!$expert_or_modify && $printer->{AUTODETECTSMB}) and printer::detect::net_smb_detect();
# We have more than one printer, so we must ask the user for a queue
# name in the fully automatic printer configuration.
- $printer->{MORETHANONE} = ($#autodetected > 0);
+ $printer->{MORETHANONE} = $#autodetected > 0;
foreach my $p (@autodetected) {
if ($p->{val}{DESCRIPTION}) {
my $menustr = $p->{val}{DESCRIPTION};
@@ -438,7 +438,7 @@ sub setup_local_autoscan {
} else {
# Always ask for queue name in recommended mode when no auto-
# detection was done
- $printer->{MORETHANONE} = ($#autodetected > 0);
+ $printer->{MORETHANONE} = $#autodetected > 0;
my $m;
for ($m = 0; $m <= 2; $m++) {
my $menustr = N("Printer on parallel port \#%s", $m);
@@ -454,8 +454,8 @@ sub setup_local_autoscan {
my $first = $menuentries->{$a};
my $second = $menuentries->{$b};
for (my $i = 0; $i <= $#prefixes; $i++) {
- my $firstinlist = ($first =~ m!^$prefixes[$i]!);
- my $secondinlist = ($second =~ m!^$::prefixes[$i]!);
+ my $firstinlist = $first =~ m!^$prefixes[$i]!;
+ my $secondinlist = $second =~ m!^$::prefixes[$i]!;
if ($firstinlist && !$secondinlist) { return -1 };
if ($secondinlist && !$firstinlist) { return 1 };
}
@@ -1599,7 +1599,7 @@ For your printer Printerdrake has found:
($printer->{MANUALMODEL} ? N("Select model manually") :
N("The model is correct")));
return 0 if !$res;
- $printer->{MANUALMODEL} = ($res eq N("Select model manually"));
+ $printer->{MANUALMODEL} = $res eq N("Select model manually");
1;
}
@@ -2264,7 +2264,7 @@ N("This command you can also use in the \"Printing command\" field of the printi
(!$raw ?
N("
The \"%s\" command also allows to modify the option settings for a particular printing job. Simply add the desired settings to the command line, e. g. \"%s <file>\". ", "lpr", ($queue ne $default ? "lpr -P $queue -Z option=setting -Z switch" : "lpr -Z option=setting -Z switch")) .
-N("To get a list of the options available for the current printer click on the \"Print option list\" button." . $scanning . $photocard) : $scanning . $photocard);
+N("To get a list of the options available for the current printer click on the \"Print option list\" button.") . $scanning . $photocard : $scanning . $photocard);
} elsif ($spooler eq "lpd") {
$dialogtext =
N("To print a file from the command line (terminal window) use the command \"%s <file>\".
@@ -2274,7 +2274,7 @@ N("This command you can also use in the \"Printing command\" field of the printi
(!$raw ?
N("
The \"%s\" command also allows to modify the option settings for a particular printing job. Simply add the desired settings to the command line, e. g. \"%s <file>\". ", "lpr", ($queue ne $default ? "lpr -P $queue -o option=setting -o switch" : "lpr -o option=setting -o switch")) .
-N("To get a list of the options available for the current printer click on the \"Print option list\" button." . $scanning . $photocard) : $scanning . $photocard);
+N("To get a list of the options available for the current printer click on the \"Print option list\" button.") . $scanning . $photocard : $scanning . $photocard);
} elsif ($spooler eq "pdq") {
$dialogtext =
N("To print a file from the command line (terminal window) use the command \"%s <file>\" or \"%s <file>\".
@@ -2685,11 +2685,11 @@ sub install_spooler {
# startup of printerdrake for several seconds.
printer::services::start_not_running_service("cups");
} elsif ($spoolers{$spooler}{service}) {
- printer::services::restart($spoolers{$spooler}{service}) ;
+ printer::services::restart($spoolers{$spooler}{service});
}
# Set the choosen spooler tools as defaults for "lpr", "lpq", "lprm", ...
- foreach (@{$spoolers{$spooler}{alternatives}}){
+ foreach (@{$spoolers{$spooler}{alternatives}}) {
set_alternative($_->[0], $_->[1]);
}
undef $w;
@@ -2892,9 +2892,9 @@ sub main {
# have a local network, to suppress some buttons in the
# recommended mode
my $havelocalnetworks_or_expert =
- ($::expert ||
+ $::expert ||
check_network($printer, $in, $upNetwork, 1) &&
- printer::detect::getIPsInLocalNetworks() != ());
+ printer::detect::getIPsInLocalNetworks() != ();
# Show a queue list window when there is at least one queue,
# when we are in expert mode, or when we are not in the
# installation.
@@ -2926,16 +2926,15 @@ sub main {
}
# Generate the list of available printers
my @printerlist =
- ((sort((map { $printer->{configured}{$_}{queuedata}{menuentry}
+ sort((map { $printer->{configured}{$_}{queuedata}{menuentry}
. ($_ eq $printer->{DEFAULT} ?
N(" (Default)") : "") }
keys(%{$printer->{configured}
|| {}})),
($printer->{SPOOLER} eq "cups" ?
printer::main::get_cups_remote_queues($printer) :
- ())))
- );
- my $noprinters = ($#printerlist < 0);
+ ()));
+ my $noprinters = $#printerlist < 0;
# Position the cursor where it were before (in case
# a button was pressed).
$menuchoice = $cursorpos;