diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-05-20 21:34:51 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-05-20 21:34:51 +0000 |
commit | a03213c1fea7fbccb5a30ccda483d833afc73e96 (patch) | |
tree | dd56b570a20ae7a0830eb26b983f72424d251911 | |
parent | e8ff31bca69b4a484eef66d40051674da3345158 (diff) | |
download | drakx-backup-do-not-use-a03213c1fea7fbccb5a30ccda483d833afc73e96.tar drakx-backup-do-not-use-a03213c1fea7fbccb5a30ccda483d833afc73e96.tar.gz drakx-backup-do-not-use-a03213c1fea7fbccb5a30ccda483d833afc73e96.tar.bz2 drakx-backup-do-not-use-a03213c1fea7fbccb5a30ccda483d833afc73e96.tar.xz drakx-backup-do-not-use-a03213c1fea7fbccb5a30ccda483d833afc73e96.zip |
perl_checker fixes
printer::printerdrake::{setup_smb,setup_socket}(): do not use undef values, but reuse those
we just calculate
printer::printerdrake::main(): fix printer::default::printer_type() callee
-rw-r--r-- | perl-install/printer/detect.pm | 18 | ||||
-rw-r--r-- | perl-install/printer/main.pm | 21 | ||||
-rwxr-xr-x | perl-install/standalone/printerdrake | 6 |
3 files changed, 22 insertions, 23 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm index 0839a6ad6..f973b8805 100644 --- a/perl-install/printer/detect.pm +++ b/perl-install/printer/detect.pm @@ -5,7 +5,7 @@ use common; use modules; use detect_devices; -sub local_detect { +sub local_detect() { modules::get_probeall("usb-interface") and eval { modules::load("printer") }; eval { modules::unload(qw(lp parport_pc parport_probe parport)) }; #- on kernel 2.4 parport has to be unloaded to probe again eval { modules::load(qw(parport_pc lp parport_probe)) }; #- take care as not available on 2.4 kernel (silent error). @@ -13,11 +13,11 @@ sub local_detect { whatPrinter(); } -sub net_detect { whatNetPrinter(1, 0) } +sub net_detect() { whatNetPrinter(1, 0) } -sub net_smb_detect { whatNetPrinter(0, 1) } +sub net_smb_detect() { whatNetPrinter(0, 1) } -sub detect { +sub detect() { local_detect(), whatNetPrinter(1, 1); } @@ -27,7 +27,7 @@ sub detect { #-MANUFACTURER:Hewlett-Packard; #-DESCRIPTION:HP LaserJet 1100 Printer; #-COMMAND SET:MLC,PCL,PJL; -sub whatPrinter { +sub whatPrinter() { my @res = (whatParport(), whatUsbport()); grep { $_->{val}{CLASS} eq "PRINTER" } @res; } @@ -242,7 +242,7 @@ sub whatNetPrinter { @res; } -sub getNetworkInterfaces { +sub getNetworkInterfaces() { # subroutine determines the list of all network interfaces reported # by "ifconfig", except "lo". @@ -269,7 +269,7 @@ sub getNetworkInterfaces { @interfaces; } -sub getIPsOfLocalMachine { +sub getIPsOfLocalMachine() { # subroutine determines all IPs which point to the local machine, # except 127.0.0.1 (localhost). @@ -311,7 +311,7 @@ sub getIPsOfLocalMachine { @local_ips; } -sub getIPsInLocalNetworks { +sub getIPsInLocalNetworks() { # subroutine determines the list of all hosts reachable in the local # networks by means of pinging the broadcast addresses. @@ -475,7 +475,7 @@ sub getSNMPModel { }; } -sub network_running { +sub network_running() { # If the network is not running return 0, otherwise 1. local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index d1da95b73..ac4ee0fbf 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -42,7 +42,7 @@ our %thedb; #------------------------------------------------------------------------------ -sub spooler { +sub spooler() { # LPD is taken from the menu for the moment because the classic LPD is # highly unsecure. Depending on how the GNU lpr development is going on # LPD support can be reactivated by uncommenting the following line. @@ -610,7 +610,7 @@ sub set_cups_autoconf { return 1; } -sub get_cups_autoconf { $sysconfig{CUPS_CONFIG} ne 'manual' ? 1 : 0 } +sub get_cups_autoconf() { $sysconfig{CUPS_CONFIG} ne 'manual' ? 1 : 0 } sub set_usermode { my ($usermode) = @_; @@ -629,7 +629,7 @@ sub set_jap_textmode { return 1; } -sub get_jap_textmode { +sub get_jap_textmode() { my @mimeconvs = cat_("$::prefix/etc/cups/mime.convs"); (m!^\s*text/plain\s+\S+\s+\d+\s+(\S+)\s*$!m and $1 eq 'cjktexttops' and return 1) foreach @mimeconvs; @@ -639,7 +639,7 @@ sub get_jap_textmode { #---------------------------------------------------------------------- # Handling of /etc/cups/cupsd.conf -sub read_cupsd_conf { +sub read_cupsd_conf() { cat_("$::prefix/etc/cups/cupsd.conf"); } sub write_cupsd_conf { @@ -1250,7 +1250,7 @@ sub write_cups_config { } @{$printer->{cupsconfig}{clientnetworks}}) . "\n" : "") . "</Location>\n"; - my ($location_start, @location) = + my ($location_start, @_location) = rip_location($printer->{cupsconfig}{cupsd_conf}, "/"); insert_location($printer->{cupsconfig}{cupsd_conf}, $location_start, @{$printer->{cupsconfig}{rootlocation}}); @@ -1334,7 +1334,7 @@ sub read_printers_conf { $printer->{SPOOLER} ||= 'cups'; } -sub get_direct_uri { +sub get_direct_uri() { #- get the local printer to access via a Device URI. my @direct_uri; local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . "/usr/sbin/lpinfo -v |"; @@ -1502,7 +1502,7 @@ sub ppd_devid_data { return ($devidmake, $devidmodel); } -sub poll_ppd_base { +sub poll_ppd_base() { #- Before trying to poll the ppd database available to cups, we have #- to make sure the file /etc/cups/ppds.dat is no more modified. #- If cups continue to modify it (because it reads the ppd files @@ -1629,7 +1629,7 @@ sub poll_ppd_base { $key =~ s/\s*\(recommended\)//; } elsif ($driver !~ /PostScript/i && $isrecommended && $isfoomatic && - (my @foundkeys = grep { + (@foundkeys = grep { /^$mf\|$model\|.*\(recommended\)/ && !/CUPS/i && $thedb{$_}{driver} eq "PPD" } keys %thedb)) { @@ -2007,7 +2007,6 @@ sub autodetectionentry_for_uri { } else { my $model = $1 if $ptaldevice =~ /^usb:(.*)$/; $model =~ s/_/ /g; - my $device = ""; foreach my $p (@autodetected) { next if !$p->{val}{MODEL} || $p->{val}{MODEL} ne $model; @@ -2347,7 +2346,7 @@ sub configure_hpoj { return $ptaldevice; } -sub config_sane { +sub config_sane() { # Add HPOJ backend to /etc/sane.d/dll.conf if needed (no individual # config file /etc/sane.d/hpoj.conf necessary, the HPOJ driver finds the # scanner automatically) @@ -2356,7 +2355,7 @@ sub config_sane { die "can't write SANE config in /etc/sane.d/dll.conf: $!"; } -sub config_photocard { +sub config_photocard() { # Add definitions for the drives p:. q:, r:, and s: to /etc/mtools.conf cat_("$::prefix/etc/mtools.conf") !~ m/^\s*drive\s+p:/m or return; diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index 7d4576656..38bb32e97 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -30,7 +30,7 @@ use c; local $_ = join '', @ARGV; -printer::main::get_usermode (); +printer::main::get_usermode(); my $printer; @@ -44,7 +44,7 @@ exit 0 unless printer::printerdrake::first_time_dialog($printer, $in, 1); # Check whether Foomatic is installed and install it if necessary printer::printerdrake::install_foomatic($in); -my $w = $in->wait_message(N("Printerdrake"), +my $_w = $in->wait_message(N("Printerdrake"), N("Reading data of installed printers...")); # Get what was installed before eval { $printer = printer::main::getinfo('') }; @@ -56,7 +56,7 @@ $commandline =~ /-lpr/ and $commandline =~ /-lpd/ and $printer->{SPOOLER} = 'lpd' and printer::main::read_configured_queues($printer); $commandline =~ /-lprng/ and - $printer->{SPOOLER} ='lprng' and printer::main::read_configured_queues($printer); + $printer->{SPOOLER} = 'lprng' and printer::main::read_configured_queues($printer); $commandline =~ /-pdq/ and $printer->{SPOOLER} = 'pdq' and printer::main::read_configured_queues($printer); -r '/etc/modules.conf' and modules::mergein_conf('/etc/modules.conf'); |