From ec747dc1097a5f80d220311dc89e9d6ec32cab31 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 28 Nov 2002 13:26:25 +0000 Subject: perl_checker adaptations --- perl-install/printer/common.pm | 6 +-- perl-install/printer/cups.pm | 2 +- perl-install/printer/detect.pm | 6 +-- perl-install/printer/gimp.pm | 18 ++++----- perl-install/printer/main.pm | 16 ++++---- perl-install/printer/printerdrake.pm | 74 ++++++++++++++++++------------------ 6 files changed, 61 insertions(+), 61 deletions(-) (limited to 'perl-install/printer') diff --git a/perl-install/printer/common.pm b/perl-install/printer/common.pm index 7742bcf71..f78d47b90 100644 --- a/perl-install/printer/common.pm +++ b/perl-install/printer/common.pm @@ -24,7 +24,7 @@ sub addentry { } } push(@lines, $entry) if $sectionfound && !$entryinserted; - return join ("\n", @lines); + return join "\n", @lines; } sub addsection { @@ -57,7 +57,7 @@ sub removeentry { } } } - return join ("", @lines); + return join "", @lines; } sub removesection { @@ -81,7 +81,7 @@ sub removesection { } } } - return join ("", @lines); + return join "", @lines; } 1; diff --git a/perl-install/printer/cups.pm b/perl-install/printer/cups.pm index c932f1f81..6999c0063 100644 --- a/perl-install/printer/cups.pm +++ b/perl-install/printer/cups.pm @@ -19,7 +19,7 @@ sub get_remote_queues { if ($2 =~ m!^ipp://([^/:]+)[:/]! && !$printer->{configured}{$queuename}) { my $server = $1; - push (@printerlist, "$queuename|$server"); + push @printerlist, "$queuename|$server"; } } } diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 2c5b42e2e..bd73c51b8 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -32,7 +32,7 @@ sub whatNetPrinter { push @portstoscan, "4010", "4020", "4030", "5503", "9100-9104" if $network; return () if $#portstoscan < 0; - my $portlist = join (",", @portstoscan); + my $portlist = join ",", @portstoscan; # Which hosts should be scanned? # (Applying nmap to a whole network is very time-consuming, because nmap @@ -41,7 +41,7 @@ sub whatNetPrinter { # hosts and then scanning only them, which is much faster) my @hostips = getIPsInLocalNetworks(); return () if $#hostips < 0; - my $hostlist = join (" ", @hostips); + my $hostlist = join " ", @hostips; # Scan network for printers, the timeout settings are there to avoid # delays caused by machines blocking their ports with a firewall @@ -190,7 +190,7 @@ sub getSMBPrinterShares { my $name = $1; my $description = $2; $description =~ s/^(\s*)//; - push (@shares, { name => $name, description => $description }); + push @shares, { name => $name, description => $description }; } } close F; diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm index 2655c4340..c3a8908a7 100644 --- a/perl-install/printer/gimp.pm +++ b/perl-install/printer/gimp.pm @@ -43,7 +43,7 @@ sub configure { } } # Add the printer entry - if (!isprinterconfigured ($queue, $configfilecontent)) { + if (!isprinterconfigured($queue, $configfilecontent)) { # Remove the old printer entry $configfilecontent = removeprinter($queue, $configfilecontent); @@ -60,7 +60,7 @@ sub configure { s/\n/\nCurrent-Printer: $printer->{DEFAULT}\n/s; } else { $configfilecontent =~ /^\s*Current\-Printer\s*:\s*(\S+)\s*$/m; - if (!isprinterconfigured ($1, $configfilecontent)) { + if (!isprinterconfigured($1, $configfilecontent)) { $configfilecontent =~ s/(Current\-Printer\s*:\s*)\S+/$1$printer->{DEFAULT}/; } @@ -114,7 +114,7 @@ sub addcupsremoteto { # Load GIMP's printer config file my $configfilecontent = readconfigfile($configfilename); # Add the printer entry - if (!isprinterconfigured ($queue, $configfilecontent)) { + if (!isprinterconfigured($queue, $configfilecontent)) { # Remove the old printer entry $configfilecontent = removeprinter($queue, $configfilecontent); # Add the new printer entry @@ -213,8 +213,8 @@ sub makeprinterentry { sub findconfigfiles { my @configfilenames; - push (@configfilenames, ".gimp-1.2/printrc") if -d "$::prefix/usr/lib/gimp/1.2"; - push (@configfilenames, ".gimp-1.3/printrc") if -d "$::prefix/usr/lib/gimp/1.3"; + push @configfilenames, ".gimp-1.2/printrc" if -d "$::prefix/usr/lib/gimp/1.2"; + push @configfilenames, ".gimp-1.3/printrc" if -d "$::prefix/usr/lib/gimp/1.3"; my @filestotreat; local *PASSWD; open PASSWD, "< $::prefix/etc/passwd" or die "Cannot read /etc/passwd!\n"; @@ -239,7 +239,7 @@ sub findconfigfiles { close F; set_permissions("$::prefix$homedir/$file", "$uid.$gid") or next; } - push (@filestotreat, "$homedir/$file"); + push @filestotreat, "$homedir/$file"; } } } @@ -282,7 +282,7 @@ sub addentry { } } push(@lines, $entry) if $sectionfound && !$entryinserted; - return join ("\n", @lines); + return join("\n", @lines); } sub addprinter { @@ -317,7 +317,7 @@ sub removeentry { } } } - return join ("", @lines); + return join "", @lines; } sub removeprinter { @@ -341,7 +341,7 @@ sub removeprinter { } } } - return join ("", @lines); + return join "", @lines; } sub isprinterconfigured { diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index 6eaa34561..d66b41385 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -403,7 +403,7 @@ sub read_printer_db(;$) { # End of drivers block $indrivers = 0; } elsif (m!^\s*(.+)\s*$!) { - push (@{$entry->{drivers}}, $1); + push @{$entry->{drivers}}, $1; } } elsif ($inautodetect) { # We are inside the autodetect block of a printers entry @@ -654,7 +654,7 @@ sub read_cups_printer_list { } else { $comment = N("(on this machine)"); } - push (@printerlist, "$queuename $comment"); + push @printerlist, "$queuename $comment"; } } close F; @@ -679,11 +679,11 @@ sub get_cups_remote_queues { !$printer->{configured}{$queuename}) { $comment = N("On CUPS server \"%s\"", $1); my $sep = "!"; - push (@printerlist, + push @printerlist, ($::expert ? N("CUPS") . $sep : "") . N("Remote Printers") . "$sep$queuename: $comment" . ($queuename eq $printer->{DEFAULT} ? - N(" (Default)") : "")); + N(" (Default)") : ""); } } } @@ -1237,7 +1237,7 @@ sub configure_hpoj { s!varLock=\"/var/lock\"!varLock=\"$::prefix/var/lock\"!g; s!varRunPrefix=\"/var/run\"!varRunPrefix=\"$::prefix/var/run\"!g; } - push (@ptalinitfunctions, $_); + push @ptalinitfunctions, $_; } } close PTALINIT; @@ -1357,7 +1357,7 @@ sub configure_hpoj { my $line = ; if ($line =~ /^\s*\S+\s+(\d+)\s+/) { my $pid = $1; - kill (15, $pid); + kill 15, $pid; } close F; } @@ -1371,7 +1371,7 @@ sub configure_hpoj { # Determine the ptal device name from already existing config files my $ptalprefix = ($bus eq "hpjd" ? "hpjd:" : "mlc:$bus:"); - my $ptaldevice = printer::hpoj::lookupDevname ($ptalprefix, $model_long, + my $ptaldevice = printer::hpoj::lookupDevname($ptalprefix, $model_long, $serialnumber_long, $base_address); # It's all done for us, the device is already configured @@ -1390,7 +1390,7 @@ sub configure_hpoj { printer::hpoj::deleteDevice($ptaldevice); if ($bus eq "par") { while (1) { - my $oldDevname = printer::hpoj::lookupDevname ("mlc:par:",undef,undef,$base_address); + my $oldDevname = printer::hpoj::lookupDevname("mlc:par:",undef,undef,$base_address); last unless defined($oldDevname); printer::hpoj::deleteDevice($oldDevname); } diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index 4673992f9..e52e6fd34 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -141,13 +141,13 @@ sub setup_printer_connection { # Choose the appropriate connection config dialog my $done = 1; for ($printer->{TYPE}) { - /LOCAL/ and setup_local_autoscan ($printer, $in, $upNetwork) and last; - /LPD/ and setup_lpd ($printer, $in, $upNetwork) and last; - /SOCKET/ and setup_socket ($printer, $in, $upNetwork) and last; - /SMB/ and setup_smb ($printer, $in, $upNetwork) and last; - /NCP/ and setup_ncp ($printer, $in, $upNetwork) and last; - /URI/ and setup_uri ($printer, $in, $upNetwork) and last; - /POSTPIPE/ and setup_postpipe ($printer, $in) and last; + /LOCAL/ and setup_local_autoscan($printer, $in, $upNetwork) and last; + /LPD/ and setup_lpd( $printer, $in, $upNetwork) and last; + /SOCKET/ and setup_socket( $printer, $in, $upNetwork) and last; + /SMB/ and setup_smb( $printer, $in, $upNetwork) and last; + /NCP/ and setup_ncp( $printer, $in, $upNetwork) and last; + /URI/ and setup_uri( $printer, $in, $upNetwork) and last; + /POSTPIPE/ and setup_postpipe( $printer, $in) and last; $done = 0; last; } return $done; @@ -166,40 +166,40 @@ sub first_time_dialog { my $localprinterspresent; if (@autodetected == ()) { $localprinterspresent = 0; - push (@printerlist, N("There are no printers found which are directly connected to your machine")); + push @printerlist, N("There are no printers found which are directly connected to your machine"); } else { $localprinterspresent = 1; foreach my $printer (@autodetected) { my $entry = $printer->{val}{DESCRIPTION}; - if ($entry) { push (@printerlist, " - $entry\n") } + if ($entry) { push @printerlist, " - $entry\n" } } my $morethanoneprinters = $#printerlist > 0; my $unknown_printers = $#autodetected - $#printerlist; if (@printerlist != ()) { - unshift (@printerlist, + unshift @printerlist, ($morethanoneprinters ? N("The following printers\n\n") : - N("The following printer\n\n"))); + N("The following printer\n\n")); if ($unknown_printers == 1) { - push (@printerlist, N("\nand one unknown printer are ")); + push @printerlist, N("\nand one unknown printer are "); } elsif ($unknown_printers > 1) { - push (@printerlist, N("\nand %d unknown printers are ", - $unknown_printers)); + push @printerlist, N("\nand %d unknown printers are ", + $unknown_printers); } else { - push (@printerlist, ($morethanoneprinters ? N("\nare ") : N("\nis "))); + push @printerlist, ($morethanoneprinters ? N("\nare ") : N("\nis ")); } - push (@printerlist, N("directly connected to your system")); + push @printerlist, N("directly connected to your system"); } else { if ($unknown_printers == 1) { - push (@printerlist, N("\nThere is one unknown printer directly connected to your system")); + push @printerlist, N("\nThere is one unknown printer directly connected to your system"); } elsif ($unknown_printers > 1) { - push (@printerlist, N("\nThere are %d unknown printers directly connected to your system", - $unknown_printers)); + push @printerlist, N("\nThere are %d unknown printers directly connected to your system", + $unknown_printers); } } } - push (@printerlist, - N(" (Make sure that all your printers are connected and turned on).\n")); + push @printerlist, + N(" (Make sure that all your printers are connected and turned on).\n"); my $localprinters = join('', @printerlist); # Do we have a local network? @@ -607,7 +607,7 @@ sub setup_local_autoscan { # Do configuration of multi-function devices and look up model name # in the printer database - setup_common ($printer, $in, $menuchoice, $device, $do_auto_detect, + setup_common($printer, $in, $menuchoice, $device, $do_auto_detect, @autodetected); 1; @@ -675,7 +675,7 @@ complete => sub { # Do configuration of multi-function devices and look up model name # in the printer database - setup_common ($printer, $in, + setup_common($printer, $in, "$modelinfo->{MANUFACTURER} $modelinfo->{MODEL}", $printer->{currentqueue}{connect}, $auto_hpoj, ({port => $printer->{currentqueue}{connect}, @@ -1098,7 +1098,7 @@ sub setup_socket { # Do configuration of multi-function devices and look up model name # in the printer database - setup_common ($printer, $in, + setup_common($printer, $in, "$modelinfo->{MANUFACTURER} $modelinfo->{MODEL}", $printer->{currentqueue}{connect}, $auto_hpoj, ({port => $printer->{currentqueue}{connect}, @@ -1183,7 +1183,7 @@ complete => sub { # Do configuration of multi-function devices and look up model name # in the printer database - setup_common ($printer, $in, + setup_common($printer, $in, "$modelinfo->{MANUFACTURER} $modelinfo->{MODEL}", $printer->{currentqueue}{connect}, $auto_hpoj, ({port => $printer->{currentqueue}{connect}, @@ -1417,7 +1417,7 @@ sub setup_common { $printer->{DBENTRY} = $entry; } } - $printer->{DBENTRY} ||= bestMatchSentence ($descr, keys %printer::main::thedb); + $printer->{DBENTRY} ||= bestMatchSentence($descr, keys %printer::main::thedb); # If the manufacturer was not guessed correctly, discard the # guess. $printer->{DBENTRY} =~ /^([^\|]+)\|/; @@ -2153,11 +2153,11 @@ Note: the photo test page can take a rather long time to get printed and on lase $in->do_pkgs->install('ImageMagick'); } # set up list of pages to print - $standard && push (@testpages, $stdtestpage); - $altletter && push (@testpages, $altlttestpage); - $alta4 && push (@testpages, $alta4testpage); - $photo && push (@testpages, $phototestpage); - $ascii && push (@testpages, $asciitestpage); + $standard && push @testpages, $stdtestpage; + $altletter && push @testpages, $altlttestpage; + $alta4 && push @testpages, $alta4testpage; + $photo && push @testpages, $phototestpage; + $ascii && push @testpages, $asciitestpage; # print the stuff @lpq_output = printer::main::print_pages($printer, @testpages); } @@ -2354,9 +2354,9 @@ sub copy_queues_from { $newspoolerstr = $printer::shortspooler_inv{$newspooler}; $oldspoolerstr = $printer::shortspooler_inv{$oldspooler}; foreach (@oldqueues) { - push (@queuesselected, 1); - push (@queueentries, { text => $_, type => 'bool', - val => \$queuesselected[$#queuesselected] }); + push @queuesselected, 1; + push @queueentries, { text => $_, type => 'bool', + val => \$queuesselected[$#queuesselected] }; } # LPRng and LPD use the same config files, therefore one sees the # queues of LPD when one uses LPRng and vice versa, but these queues @@ -2854,12 +2854,12 @@ sub main { 0) ? "\@addprinter" : "\@quit"; if ($menuchoice ne "\@quit") { $printer->{SPOOLER} ||= - setup_default_spooler ($printer, $in, $upNetwork) || + setup_default_spooler($printer, $in, $upNetwork) || return; } } else { # Ask for a spooler when none is defined - $printer->{SPOOLER} ||= setup_default_spooler ($printer, $in, $upNetwork) || return; + $printer->{SPOOLER} ||= setup_default_spooler($printer, $in, $upNetwork) || return; # This entry and the check for this entry have to use # the same translation to work properly my $spoolerentry = N("Printing system: "); @@ -3022,7 +3022,7 @@ sub main { } # Function to switch to another spooler if ($menuchoice eq "\@spooler") { - $printer->{SPOOLER} = setup_default_spooler ($printer, $in, $upNetwork) || $printer->{SPOOLER}; + $printer->{SPOOLER} = setup_default_spooler($printer, $in, $upNetwork) || $printer->{SPOOLER}; next; } # Rip the queue name out of the chosen menu entry -- cgit v1.2.1