diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-27 20:50:12 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-27 20:50:12 +0000 |
commit | b0d554c4155060ed665844fdf7b2a08db9bb3356 (patch) | |
tree | d1236029c2ac147b49a2da74bf132c3f56619406 /perl-install/printer | |
parent | c2b148e1e94892d8d72000ed087b607ae28b5808 (diff) | |
download | drakx-backup-do-not-use-b0d554c4155060ed665844fdf7b2a08db9bb3356.tar drakx-backup-do-not-use-b0d554c4155060ed665844fdf7b2a08db9bb3356.tar.gz drakx-backup-do-not-use-b0d554c4155060ed665844fdf7b2a08db9bb3356.tar.bz2 drakx-backup-do-not-use-b0d554c4155060ed665844fdf7b2a08db9bb3356.tar.xz drakx-backup-do-not-use-b0d554c4155060ed665844fdf7b2a08db9bb3356.zip |
perl_checker adaptations
Diffstat (limited to 'perl-install/printer')
-rw-r--r-- | perl-install/printer/detect.pm | 2 | ||||
-rw-r--r-- | perl-install/printer/gimp.pm | 16 | ||||
-rw-r--r-- | perl-install/printer/main.pm | 4 | ||||
-rw-r--r-- | perl-install/printer/office.pm | 28 | ||||
-rw-r--r-- | perl-install/printer/printerdrake.pm | 26 |
5 files changed, 37 insertions, 39 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 7ab4a9f1b..2c5b42e2e 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -79,7 +79,7 @@ sub whatNetPrinter { val => { CLASS => 'PRINTER', MODEL => N("Unknown Model"), MANUFACTURER => "", - DESCRIPTION => "$share->{description}", + DESCRIPTION => $share->{description}, SERIALNUMBER => "" } }; diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm index c6d7a08d0..2655c4340 100644 --- a/perl-install/printer/gimp.pm +++ b/perl-install/printer/gimp.pm @@ -32,8 +32,8 @@ sub configure { "/etc/foomatic/$queue.ppd"); } elsif (-r "$::prefix/usr/share/postscript/ppd/$queue.ppd") { # Check PPD directory of GPR, too - run_program::rooted - ($::prefix, + run_program::rooted( + $::prefix, "ln", "-sf", "/usr/share/postscript/ppd/$queue.ppd", "/etc/foomatic/$queue.ppd"); @@ -89,13 +89,13 @@ sub addcupsremoteto { # Remove server name from queue name $q =~ s/^([^@]*)@.*$/$1/; if (-x "$::prefix/usr/bin/wget") { - eval(run_program::rooted - ($::prefix, "/usr/bin/wget", "-O", + eval(run_program::rooted( + $::prefix, "/usr/bin/wget", "-O", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$q.ppd")); } else { - eval(run_program::rooted - ($::prefix, "/usr/bin/curl", "-o", + eval(run_program::rooted( + $::prefix, "/usr/bin/curl", "-o", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$q.ppd")); } @@ -198,7 +198,7 @@ sub makeprinterentry { $configfile = addentry($queue, "Driver: $gimpprintdriver", $configfile); $configfile = removeentry($queue, "Destination:", $configfile); $configfile = addentry($queue, - "Destination: /usr/bin/$spoolers{$printer->{SPOOLER}{print_command}} -P $queue -o raw", $configfile); + sprintf("Destination: /usr/bin/%s -P %s -o raw", $spoolers{$printer->{SPOOLER}{print_command}}, $queue), $configfile); } else { $configfile = removeentry($queue, "PPD-File:", $configfile); $configfile = addentry($queue, "PPD-File: /etc/foomatic/$queue.ppd", $configfile); @@ -206,7 +206,7 @@ sub makeprinterentry { $configfile = addentry($queue, "Driver: ps2", $configfile); $configfile = removeentry($queue, "Destination:", $configfile); $configfile = addentry($queue, - "Destination: /usr/bin/$spoolers{$printer->{SPOOLER}{print_command}} -P $queue", $configfile); + sprintf("Destination: /usr/bin/%s -P %s", $spoolers{$printer->{SPOOLER}{print_command}}, $queue), $configfile); } return $configfile; } diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index a93daf28f..6eaa34561 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -58,7 +58,7 @@ sub spooler { sub printer_type($) { my ($printer) = @_; - foreach ($printer->{SPOOLER}) { + for ($printer->{SPOOLER}) { /cups/ && return @printer_type_inv{qw(LOCAL), qw(LPD SOCKET SMB), $::expert ? qw(URI) : ()}; @@ -1045,7 +1045,7 @@ sub restart_queue($) { my $queue = $printer->{QUEUE}; # Restart the daemon(s) - foreach ($printer->{SPOOLER}) { + for ($printer->{SPOOLER}) { /cups/ && do { #- restart cups. printer::services::restart("cups"); diff --git a/perl-install/printer/office.pm b/perl-install/printer/office.pm index 2498bcabe..459ae4d8e 100644 --- a/perl-install/printer/office.pm +++ b/perl-install/printer/office.pm @@ -55,13 +55,13 @@ sub configureoffice { my $queue = $1; my $server = $2; if (-x "$::prefix/usr/bin/wget") { - eval(run_program::rooted - ($::prefix, "/usr/bin/wget", "-O", + eval(run_program::rooted( + $::prefix, "/usr/bin/wget", "-O", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$queue.ppd")); } else { - eval(run_program::rooted - ($::prefix, "/usr/bin/curl", "-o", + eval(run_program::rooted( + $::prefix, "/usr/bin/curl", "-o", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$queue.ppd")); } @@ -124,13 +124,13 @@ sub add_cups_remote_to_office { # Remove server name from queue name $q =~ s/^([^@]*)@.*$/$1/; if (-x "$::prefix/usr/bin/wget") { - eval(run_program::rooted - ($::prefix, "/usr/bin/wget", "-O", + eval(run_program::rooted( + $::prefix, "/usr/bin/wget", "-O", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$q.ppd")); } else { - eval(run_program::rooted - ($::prefix, "/usr/bin/curl", "-o", + eval(run_program::rooted( + $::prefix, "/usr/bin/curl", "-o", "/etc/foomatic/$queue.ppd", "http://$server:631/printers/$q.ppd")); } @@ -207,7 +207,7 @@ sub makestarofficeprinterentry { # symbol correctly. $configfile = removeentry("ports", "$queue=", $configfile); $configfile = addentry("ports", - "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$spoolers{$printer->{SPOOLER}{print_command}} -P $queue", + "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/" . $spoolers{$printer->{SPOOLER}{print_command}} . " -P $queue", $configfile); # Make printer's section $configfile = addsection("$queue,PostScript,$queue", $configfile); @@ -261,14 +261,14 @@ sub makeopenofficeprinterentry { # symbol correctly. $configfile = removeentry($queue, "Command=", $configfile); $configfile = addentry($queue, - "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/$spoolers{$printer->{SPOOLER}{print_command}} -P $queue", + "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/" . $spoolers{$printer->{SPOOLER}{print_command}} . " -P $queue", $configfile); # "Comment" line $configfile = removeentry($queue, "Comment=", $configfile); if ($printer->{configured}{$queue} && $printer->{configured}{$queue}{queuedata}{desc}) { - $configfile = addentry - ($queue, + $configfile = addentry( + $queue, "Comment=$printer->{configured}{$queue}{queuedata}{desc}", $configfile); } else { @@ -280,8 +280,8 @@ sub makeopenofficeprinterentry { $configfile = removeentry($queue, "Location=", $configfile); if ($printer->{configured}{$queue} && $printer->{configured}{$queue}{queuedata}{loc}) { - $configfile = addentry - ($queue, + $configfile = addentry( + $queue, "Location=$printer->{configured}{$queue}{queuedata}{loc}", $configfile); } else { diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index aea361bab..e2ea9f52b 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -140,7 +140,7 @@ sub setup_printer_connection { my ($printer, $in, $upNetwork) = @_; # Choose the appropriate connection config dialog my $done = 1; - foreach ($printer->{TYPE}) { + 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; @@ -155,7 +155,7 @@ sub setup_printer_connection { sub first_time_dialog { my ($printer, $in, $upNetwork) = @_; - return 1 if printer::default::get_spooler () or $::isInstall; + return 1 if printer::default::get_spooler() or $::isInstall; # Wait message my $w = $in->wait_message(N("Printerdrake"), N("Checking your system...")); @@ -339,7 +339,6 @@ If you want to add, remove, or rename a printer, or if you want to change the de sub setup_local_autoscan { my ($printer, $in, $upNetwork) = @_; - my $device; my $queue = $printer->{OLD_QUEUE}; my $expert_or_modify = $::expert || !$printer->{NEW}; my $do_auto_detect = @@ -866,7 +865,7 @@ Do you really want to continue setting up this printer as you are doing now?"), #- build a suitable URI. $printer->{currentqueue}{connect} = join '', ("smb://", ($smbuser && ($smbuser . - ($smbpassword && ":$smbpassword") . "@")), ($workgroup && "$workgroup/"), + ($smbpassword && ":$smbpassword") . '@')), ($workgroup && "$workgroup/"), ($smbserver || $smbserverip), "/$smbshare"); if (!$::testing && !files_exist('/usr/bin/smbclient')) { @@ -935,7 +934,7 @@ complete => sub { # Generate the Foomatic URI $printer->{currentqueue}{connect} = join '', ("ncp://", ($ncpuser && ($ncpuser . - ($ncppassword && ":$ncppassword") . "@")), + ($ncppassword && ":$ncppassword") . '@')), "$ncpserver/$ncpqueue"); $in->do_pkgs->install('ncpfs') if !$::testing && !files_exist('/usr/bin/nprint'); @@ -952,7 +951,7 @@ sub setup_socket { $in->set_help('setupSocket') if $::isInstall; - my ($hostname, $port, $uri, $remotehost,$remoteport); + my ($hostname, $port, $uri, $remotehost, $remoteport); my $queue = $printer->{OLD_QUEUE}; if ($printer->{configured}{$queue} && $printer->{currentqueue}{connect} =~ m!^(socket:|ptal:/hpjd:)!) { @@ -1231,8 +1230,7 @@ complete => sub { sub setup_common { - my ($printer, $in, $makemodel, $device, $do_auto_detect, - @autodetected) = @_; + my ($printer, $in, $makemodel, $device, $do_auto_detect, @autodetected) = @_; #- Check whether the printer is an HP multi-function device and #- configure HPOJ if it is one @@ -2200,16 +2198,16 @@ sub printer_help { $raw = 1; } # Information about scanning with HP's multi-function devices - $scanning = scanner_help - ($printer->{configured}{$queue}{queuedata}{make} . " " . + $scanning = scanner_help( + $printer->{configured}{$queue}{queuedata}{make} . " " . $printer->{configured}{$queue}{queuedata}{model}, $printer->{configured}{$queue}{queuedata}{connect}); if ($scanning) { $scanning = "\n\n$scanning\n\n"; } # Information about photo card access with HP's multi-function devices - $photocard = photocard_help - ($printer->{configured}{$queue}{queuedata}{make} . " " . + $photocard = photocard_help( + $printer->{configured}{$queue}{queuedata}{make} . " " . $printer->{configured}{$queue}{queuedata}{model}, $printer->{configured}{$queue}{queuedata}{connect}); if ($photocard) { @@ -2494,8 +2492,8 @@ sub check_network { if ($choice eq N("Configure the network now")) { if ($::isInstall) { require network::netconnect; - network::netconnect::main - ($in->{prefix}, $in->{netcnx} ||= {}, + network::netconnect::main( + $in->{prefix}, $in->{netcnx} ||= {}, $in->{netc}, $in->{mouse}, $in, $in->{intf}, 0, $in->{lang} eq "fr_FR" && |