From aaff6dff3ac0e9b19810fc1bc836f30c19918e5d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 31 Jul 2002 11:59:03 +0000 Subject: make new perl_checker happy --- perl-install/Makefile | 2 +- perl-install/Xconfig/card.pm | 2 +- perl-install/any.pm | 8 ++--- perl-install/bootlook.pm | 2 +- perl-install/commands.pm | 3 +- perl-install/crypto.pm | 2 +- perl-install/detect_devices.pm | 8 ++--- perl-install/install2.pm | 1 - perl-install/install_any.pm | 2 +- perl-install/install_gtk.pm | 2 +- perl-install/install_interactive.pm | 2 +- perl-install/install_steps_gtk.pm | 2 +- perl-install/install_steps_interactive.pm | 4 +-- perl-install/interactive/stdio.pm | 2 +- perl-install/keyboard.pm | 1 - perl-install/modules.pm | 2 +- perl-install/mouse.pm | 4 +-- perl-install/my_gtk.pm | 20 ++++++------ perl-install/network/adsl.pm | 2 +- perl-install/network/ethernet.pm | 8 ++--- perl-install/network/isdn.pm | 8 ++--- perl-install/network/netconnect.pm | 51 +++++++++++++++---------------- perl-install/network/tools.pm | 8 ++--- perl-install/pkgs.pm | 2 +- perl-install/printer.pm | 18 +++++------ perl-install/printerdrake.pm | 6 ++-- perl-install/resize_fat/main.pm | 21 +------------ perl-install/services.pm | 4 +-- perl-install/standalone/drakgw | 19 +++++++----- perl-install/standalone/keyboarddrake | 4 +-- perl-install/standalone/mousedrake | 1 - 31 files changed, 100 insertions(+), 121 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Makefile b/perl-install/Makefile index 339b3f49d..fad7888e1 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -45,7 +45,7 @@ $(DIRS): $(MAKE) -C $@ test_pms: verify_c - for i in install2 install_steps_*.pm standalone/keyboarddrake standalone/XFdrake standalone/drakboot; do perl_checker -I. -no_cw -excludec -excludehelp -excludeurpm -excluderesize_fat::c_rewritten -excludeMDK::Common::Globals -excludeCGI -excludestandalone -excludeURPM -excludeURPM::Package -excludeURPM::DB -excludeURPM::Resolve $$i; done + for i in install2 install_steps_*.pm standalone/keyboarddrake standalone/XFdrake standalone/drakboot; do perl_checker -I. -no_cw $$i; done for i in install2 install_steps_*.pm; do perl -cw -I. $$i; done verify_c: diff --git a/perl-install/Xconfig/card.pm b/perl-install/Xconfig/card.pm index 0b2b6c868..26a49dab8 100644 --- a/perl-install/Xconfig/card.pm +++ b/perl-install/Xconfig/card.pm @@ -294,7 +294,7 @@ sub install_server { my $prog = server_binary($card); - my @packages = (); + my @packages; push @packages, using_xf4($card) ? 'XFree86-server' : "XFree86-$card->{server}" if ! -x "$::prefix$prog"; #- additional packages to install according available card. diff --git a/perl-install/any.pm b/perl-install/any.pm index 6f59fc248..e0dfb62d1 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -281,7 +281,7 @@ You can add some more or change the existing ones."), $prefix = "linux"; } else { $e = { type => 'other' }; - $prefix = arch() =~ /sparc/ ? "sunos" : arch() =~ /ppc/ ? "macos" : "windows";; + $prefix = arch() =~ /sparc/ ? "sunos" : arch() =~ /ppc/ ? "macos" : "windows"; } $e->{label} = $prefix; for (my $nb = 0; member($e->{label}, @labels); $nb++) { $e->{label} = "$prefix-$nb" } @@ -492,11 +492,7 @@ BOOTPROTO="none" PEERDNS="$toreplace{peerdns}" END foreach (1..2) { - if ($toreplace{"dns$_"}) { - print IFCFG <show_all(); Gtk->main_iteration while Gtk->events_pending; $::isEmbedded and kill USR2, $::CCPID; -$inmain=1; +$inmain = 1; Gtk->main; Gtk->exit(0); diff --git a/perl-install/commands.pm b/perl-install/commands.pm index 99b0164d7..3294c1060 100644 --- a/perl-install/commands.pm +++ b/perl-install/commands.pm @@ -1,3 +1,5 @@ +package commands; # $Id$ + #-######################################################################## #- This file implement many common shell commands: #- true, false, cat, which, dirname, basename, rmdir, lsmod, grep, tr, @@ -5,7 +7,6 @@ #- swapoff, ls, cp, ps, dd, head, tail, strings, hexdump, more, insmod, #- modprobe, route, df, kill, lspci, lssbus, dmesg, sort, du, #-######################################################################## -package commands; # $Id$ use diagnostics; use strict; diff --git a/perl-install/crypto.pm b/perl-install/crypto.pm index fb15db673..06c8db3e6 100644 --- a/perl-install/crypto.pm +++ b/perl-install/crypto.pm @@ -40,7 +40,7 @@ my %static_mirrors = ( # "ackbar" => [ "Ackbar", "/updates", "a", "a" ], ); -my %mirrors = (); +my %mirrors; my %deps = ( 'libcrypto.so.0' => 'openssl', diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 57c2145ef..3da219e8b 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -17,7 +17,7 @@ use c; #- Globals #-##################################################################################### my @netdevices = map { my $l = $_; map { "$l$_" } (0..3) } qw(eth tr fddi plip); -my %serialprobe = (); +my %serialprobe; #-###################################################################################### #- Functions @@ -464,7 +464,7 @@ sub hasUltra66 { } sub whatParport() { - my @res = (); + my @res; foreach (0..3) { my $elem = {}; local *F; @@ -512,7 +512,7 @@ sub whatUsbport() { # manufacturer and model names, so that they are easily matched to the # printer entries in the Foomatic database my $i; - my @res = (); + my @res; foreach $i (0..15) { my $port = "/dev/usb/lp$i"; my $realport = devices::make("$port"); @@ -611,7 +611,7 @@ sub probeSerialDevices { #- ... but still take some time :-) local *F; open F, "$ENV{LD_LOADER} serial_probe |"; local $_; - my %current = (); while () { + my %current; while () { $serialprobe{$current{DEVICE}} = { %current } and %current = () if /^\s*$/ && $current{DEVICE}; $current{$1} = $2 if /^([^=]+)=(.*?)\s*$/; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 88f5b0967..0c9c6c35f 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -1,4 +1,3 @@ - package install2; # $Id$ use diagnostics; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 824584f81..14565b100 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -37,7 +37,7 @@ $boot_medium = 1; my $postinstall_rpms = ''; my $current_medium = $boot_medium; my $asked_medium = $boot_medium; -my $cdrom = undef; +my $cdrom; sub useMedium($) { #- before ejecting the first CD, there are some files to copy! #- does nothing if the function has already been called. diff --git a/perl-install/install_gtk.pm b/perl-install/install_gtk.pm index b50e7d494..712fbbcda 100644 --- a/perl-install/install_gtk.pm +++ b/perl-install/install_gtk.pm @@ -156,7 +156,7 @@ sub create_steps_window { $darea->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); $darea->signal_connect(expose_event => sub { $draw_pix->($f->('')) }); if ($step->{reachable}) { - $darea->signal_connect(enter_notify_event => sub { $in_button=1; $draw_pix->($f->('-on')) }); + $darea->signal_connect(enter_notify_event => sub { $in_button = 1; $draw_pix->($f->('-on')) }); $darea->signal_connect(leave_notify_event => sub { undef $in_button; $draw_pix->($f->('')) }); $darea->signal_connect(button_press_event => sub { $draw_pix->($f->('-click')) }); $darea->signal_connect(button_release_event => sub { $in_button && die "setstep $step_name\n" }); diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm index 2ff4d27e6..3f99a5833 100644 --- a/perl-install/install_interactive.pm +++ b/perl-install/install_interactive.pm @@ -60,7 +60,7 @@ For this, create a partition (or click on an existing one). Then choose action ``Mount point'' and set it to `/'"), 1) or return; } if (!grep { isSwap($_) } @fstab) { - $o->ask_warn('', _("You must have a swap partition")), $ok=0 if !$::expert; + $o->ask_warn('', _("You must have a swap partition")), $ok = 0 if !$::expert; $ok &&= $::expert || $o->ask_okcancel('', _("You don't have a swap partition.\n\nContinue anyway?")); } if (arch() =~ /ia64/ && !fsedit::has_mntpoint("/boot/efi", $all_hds)) { diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 7d3c1503a..4b44f10a3 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -78,7 +78,7 @@ sub new($$) { elsif (/Permedia2/) { @servers = qw(3DLabs) } else { @servers = qw(Xsun24) } } elsif (arch() =~ /ia64/) { - @servers= 'XFree86'; + @servers = 'XFree86'; } elsif (arch() eq "ppc") { @servers = qw(Xpmac); } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index c28187579..212e3fd4a 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -719,8 +719,8 @@ sub reallyChooseGroups { sub chooseCD { my ($o, $packages) = @_; my @mediums = grep { $_ != $install_any::boot_medium } pkgs::allMediums($packages); - my @mediumsDescr = (); - my %mediumsDescr = (); + my @mediumsDescr; + my %mediumsDescr; if (!common::usingRamdisk()) { #- mono-cd in case of no ramdisk diff --git a/perl-install/interactive/stdio.pm b/perl-install/interactive/stdio.pm index 041235cef..67198d00e 100644 --- a/perl-install/interactive/stdio.pm +++ b/perl-install/interactive/stdio.pm @@ -58,7 +58,7 @@ ask_fromW_begin: } }; - my @labels = (); + my @labels; my $format_label = sub { my ($e) = @_; return "`${$e->{val}}' $e->{label} $e->{text}\n" }; my $do_widget = sub { my ($e, $ind) = @_; diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index c730c2739..38cd03c72 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -1,4 +1,3 @@ - package keyboard; # $Id$ use diagnostics; diff --git a/perl-install/modules.pm b/perl-install/modules.pm index d3bada086..33672bb10 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -247,7 +247,7 @@ sub write_conf { if $v2 && !$written->{$mod}{$type}; } } - my @l = (); + my @l; push @l, 'scsi_hostadapter' if !is_empty_array_ref($conf{scsi_hostadapter}{probeall}); push @l, 'bttv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall(); append_to_etc_modules($prefix, @l); diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 1ab19052a..f41f984ff 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -477,7 +477,7 @@ sub test_mouse { 0, 360*64); } } elsif ($nb == 3) { - $wait=1; + $wait = 1; $darea->window->draw_pixmap ($darea->style->bg_gc('normal'), $aru, 0, 0, ($darea->allocation->[2]-$width)/2+102, ($darea->allocation->[3]-$height)/2 + 57, @@ -488,7 +488,7 @@ sub test_mouse { 13, 62); Gtk->timeout_add(200, sub { $wait = 0 }); } elsif ($nb == 4) { - $wait=1; + $wait = 1; $darea->window->draw_pixmap ($darea->style->bg_gc('normal'), $ard, 0, 0, ($darea->allocation->[2]-$width)/2+102, ($darea->allocation->[3]-$height)/2 + 131, diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index d8ecf8b47..04aabea56 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -63,7 +63,7 @@ sub new { $style->font(Gtk::Gdk::Font->fontset_load("-adobe-utopia-regular-r-*-*-25-*-*-*-p-*-iso8859-*")); my $w = $style->font->string_width($::Wizard_title); $draw1->signal_connect(expose_event => sub { - for (my $i=0; $i < (540/$y1); $i++) { + for (my $i = 0; $i < (540/$y1); $i++) { $draw1->window->draw_pixmap ($draw1->style->bg_gc('normal'), $im_up, 0, 0, 0, $y1*$i, $x1 , $y1); @@ -75,7 +75,7 @@ sub new { } }); $draw2->signal_connect(expose_event => sub { - for (my $i=0; $i < (300/$y2); $i++) { + for (my $i = 0; $i < (300/$y2); $i++) { $draw2->window->draw_pixmap ($draw2->style->bg_gc('normal'), $im_left, 0, 0, 0, $y2*$i, $x2 , $y2); @@ -377,7 +377,7 @@ sub gtkctree_children { @l; } -my @icon_paths = (); +my @icon_paths; sub add_icon_path { push @icon_paths, @_ } sub icon_paths { @@ -387,16 +387,16 @@ sub icon_paths { sub gtkcreate_xpm { my ($f) = @_; my $rw = gtkroot(); - $f =~ m|.xpm$| or $f="$f.xpm"; - if ($f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach icon_paths() } + $f =~ m|.xpm$| or $f = "$f.xpm"; + if ($f !~ /\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } my @l = Gtk::Gdk::Pixmap->create_from_xpm($rw, new Gtk::Style->bg('normal'), $f) or die "gtkcreate_xpm: missing pixmap file $f"; @l; } sub gtkcreate_png { my ($f) = shift; - $f =~ m|.png$| or $f="$f.png"; - if ($f !~ /\//) { -e "$_/$f" and $f="$_/$f", last foreach icon_paths() } + $f =~ m|.png$| or $f = "$f.png"; + if ($f !~ /\//) { -e "$_/$f" and $f = "$_/$f", last foreach icon_paths() } my $im = Gtk::Gdk::ImlibImage->load_image($f) or die "gtkcreate_png: missing png file $f"; $im->render($im->rgb_width, $im->rgb_height); ($im->move_image(), $im->move_mask); @@ -423,7 +423,7 @@ sub create_pix_text { elsif ($background =~ /#(\d+)#(\d+)#(\d+)/) { $color_background = gtkcolor(map{$_*65535/255}($1, $2, $3)) } elsif (ref($background) eq 'Gtk::Gdk::Pixmap' && $x_back && $y_back) { $backpix = 1 } my $fake_darea = new Gtk::DrawingArea; - my $style= $fake_darea->style->copy(); + my $style = $fake_darea->style->copy(); if (ref($font) eq 'Gtk::Gdk::Font') { $style->font($font); } else { @@ -679,14 +679,14 @@ sub write_on_pixmap { my $gc = Gtk::Gdk::GC->new(gtkroot()); $gc->set_foreground(gtkcolor(8448, 17664, 40191)); #- in hex : 33, 69, 157 - my $darea= new Gtk::DrawingArea(); + my $darea = new Gtk::DrawingArea(); $darea->size($width, $height); $darea->set_usize($width, $height); my $draw = sub { my $style = new Gtk::Style; #- i18n : you can change the font. $style->font(Gtk::Gdk::Font->fontset_load(_("-adobe-times-bold-r-normal--17-*-100-100-p-*-iso8859-*,*-r-*"))); - my $y_pos2= $y_pos; + my $y_pos2 = $y_pos; foreach (@text) { $darea->window->draw_string($style->font, $gc, $x_pos, $y_pos2, $_); $y_pos2 += 20; diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index d27292cf4..8df96aa00 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -71,7 +71,7 @@ sub adsl_detect { return 0; my ($interface) = @_; run_program::rooted($prefix, "ifconfig $interface 10.0.0.10 netmask 255.255.255.0"); - my $ret=run_program::rooted($prefix, "/bin/ping -c 1 10.0.0.138 2> /dev/null"); + my $ret = run_program::rooted($prefix, "/bin/ping -c 1 10.0.0.138 2> /dev/null"); run_program::rooted($prefix, "ifconfig $interface 0.0.0.0 netmask 255.255.255.0"); run_program::rooted($prefix, "/etc/init.d/network restart"); $ret; diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 1bdaec245..aa2339fe2 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -25,7 +25,7 @@ sub configure_cable { # such as ``mybox.mylab.myco.com''."), # [_("Host name:")], [ \$netcnx->{cable}{hostname} ]); if ($::expert) { - my @m=( + my @m = ( { description => "dhcpcd", c => 1}, { description => "dhcpxd", @@ -83,7 +83,7 @@ sub conf_network_card { my ($netc, $intf, $type, $ipadr, $netadr) = @_; #-type =static or dhcp any::load_category($in, 'network/main|usb', !$::expert, 1); - my @all_cards=conf_network_card_backend($netc, $intf, $type, undef, $ipadr, $netadr); + my @all_cards = conf_network_card_backend($netc, $intf, $type, undef, $ipadr, $netadr); my $interface; @all_cards == () and $in->ask_warn('', _("No ethernet network adapter has been detected on your system. I cannot set up this connection type.")) and return; @@ -97,7 +97,7 @@ I cannot set up this connection type.")) and return; l1: $::isStandalone and modules::write_conf($prefix); - my $device=conf_network_card_backend($netc, $intf, $type, $interface, $ipadr, $netadr, $interface); + my $device = conf_network_card_backend($netc, $intf, $type, $interface, $ipadr, $netadr, $interface); # if ( $::isStandalone and !($type eq "dhcp")) { # $in->ask_yesorno(_("Network interface"), # _("I'm about to restart the network device:\n") . $device . _("\nDo you agree?"), 1) and configureNetwork2($in, $prefix, $netc, $intf) and system("$prefix/sbin/ifdown $device;$prefix/sbin/ifup $device"); @@ -179,7 +179,7 @@ sub configureNetwork { my @all_cards = conf_network_card_backend ($netc, $intf, undef, undef, undef, undef); configureNetwork_step_1: - my $n_card=0; + my $n_card = 0; $netc ||= {}; my $last; foreach (@l) { my $intf2 = findIntf($intf ||= {}, $_); diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index 504655d11..f9c8bd409 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -74,7 +74,7 @@ sub isdn_write_config_backend { if ($isdn->{id}) { isdn_detect_backend($isdn); } else { - my $a=""; + my $a = ""; defined $isdn->{$_} and $a .= "$_=" . $isdn->{$_} . " " foreach qw(type protocol mem io io0 io1 irq); $isdn->{driver} eq "hisax" and $a.="id=HiSax"; modules::set_options($isdn->{driver}, $a); @@ -86,7 +86,7 @@ sub isdn_write_config_backend { chmod 0600, $f; } foreach my $f ('isdn1B.conf', 'isdn2B.conf') { - my $a=1; + my $a = 1; substInFile { s/EAZ =.*/EAZ = $isdn->{phone_in}/; s/PHONE_OUT =.*/PHONE_OUT = $isdn->{phone_out}/; @@ -167,7 +167,7 @@ sub isdn_ask_info { my ($isdn, $netc) = @_; my $f = "$ENV{SHARE_PATH}/ldetect-lst/isdn.db"; $f = "$prefix$f" if !-e $f; - my $str= $in->ask_from_treelist(_("ISDN Configuration"), _("Select your provider.\nIf it isn't listed, choose Unlisted."), + my $str = $in->ask_from_treelist(_("ISDN Configuration"), _("Select your provider.\nIf it isn't listed, choose Unlisted."), '|', ['Unlisted - edit manually', read_providers_backend($f)], 'Unlisted - edit manually') or return; @@ -179,7 +179,7 @@ sub isdn_ask_info { } sub isdn_ask_protocol { - my @toto=( + my @toto = ( { description => $::expert ? _("Europe protocol (EDSS1)") : _("Europe protocol"), protokol => 2}, { description => $::expert ? _("Protocol for the rest of the world\nNo D-Channel (leased lines)") : _("Protocol for the rest of the world"), diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index f15797687..8aef0b3c8 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -1,4 +1,3 @@ - package network::netconnect; use diagnostics; @@ -31,13 +30,13 @@ sub intro { read_net_conf($prefix, $netcnx, $netc); if (!$::isWizard) { if (connected()) { - $text=_("You are currently connected to internet.") . (-e $disconnect_file ? _("\nYou can disconnect or reconfigure your connection.") : _("\nYou can reconfigure your connection.")); - $connected=1; + $text = _("You are currently connected to internet.") . (-e $disconnect_file ? _("\nYou can disconnect or reconfigure your connection.") : _("\nYou can reconfigure your connection.")); + $connected = 1; } else { - $text=_("You are not currently connected to Internet.") . (-e $connect_file ? _("\nYou can connect to Internet or reconfigure your connection.") : _("\nYou can reconfigure your connection.")); - $connected=0; + $text = _("You are not currently connected to Internet.") . (-e $connect_file ? _("\nYou can connect to Internet or reconfigure your connection.") : _("\nYou can reconfigure your connection.")); + $connected = 0; } - my @l=( + my @l = ( !$connected && -e $connect_file ? { description => _("Connect"), c => 1} : (), $connected && -e $disconnect_file ? { description => _("Disconnect"), @@ -62,11 +61,11 @@ sub intro { sub detect { my ($auto_detect, $net_install) = @_; - my $isdn={}; + my $isdn = {}; require network::isdn; network::isdn->import; isdn_detect_backend($isdn); - $auto_detect->{isdn}{$_}=$isdn->{$_} foreach qw(description vendor id driver card_type type); + $auto_detect->{isdn}{$_} = $isdn->{$_} foreach qw(description vendor id driver card_type type); $auto_detect->{isdn}{description} =~ s/.*\|//; modules::load_category('network/main|usb'); @@ -76,20 +75,20 @@ sub detect { require network::adsl; network::adsl->import; map { - (!$net_install and adsl_detect($_->[0])) ? $auto_detect->{adsl}=$_->[0] : $auto_detect->{lan}{$_->[0]}=$_->[1] } @all_cards; - my $modem={}; + (!$net_install and adsl_detect($_->[0])) ? $auto_detect->{adsl} = $_->[0] : $auto_detect->{lan}{$_->[0]} = $_->[1] } @all_cards; + my $modem = {}; require network::modem; network::modem->import; modem_detect_backend($modem); - $modem->{device} and $auto_detect->{modem}=$modem->{device}; + $modem->{device} and $auto_detect->{modem} = $modem->{device}; } sub pre_func { my ($text) = @_; $in->isa('interactive_gtk') or return; - $::Wizard_no_previous=1; + $::Wizard_no_previous = 1; if ($::isStandalone) { - $::Wizard_splash=1; + $::Wizard_splash = 1; require my_gtk; my_gtk->import(qw(:wrappers)); my $W = my_gtk->new(_("Network Configuration Wizard")); @@ -103,7 +102,7 @@ sub pre_func { ) ); $W->main; - $::Wizard_splash=0; + $::Wizard_splash = 0; } else { #- for i18n : %s is the type of connection of the list: (modem, isdn, adsl, cable, local network); $in->ask_okcancel(_("Network Configuration Wizard"), _("\n\n\nWe are now going to configure the %s connection.\n\n\nPress OK to continue.",_($_[0])), 1); @@ -160,7 +159,7 @@ ifdown eth0 step_1: $::Wizard_no_previous=1; - my @profiles=get_profiles(); + my @profiles = get_profiles(); $in->ask_from(_("Network Configuration Wizard"), _("Welcome to The Network Configuration Wizard. @@ -193,8 +192,8 @@ If you don't want to use the auto detection, deselect the checkbox. [_("Cable connection"), $netc->{autodetect}{cable}, __("cable connection detected"), \$conf{cable}], [_("LAN connection"), $netc->{autodetect}{lan}, __("ethernet card(s) detected"), \$conf{lan}] ); - my $i=0; - map { defined $set_default or do { $_->[1] and $set_default=$i }; $i++ } @l; + my $i = 0; + map { defined $set_default or do { $_->[1] and $set_default = $i }; $i++ } @l; @l = ( [_("Normal modem connection") . if_($netc->{autodetect}{modem}, " - " . _("detected on port %s", $netc->{autodetect}{modem})), \$conf{modem}], [_("ISDN connection") . if_($netc->{autodetect}{isdn}{description}, " - " . _("detected %s", $netc->{autodetect}{isdn}{description})), \$conf{isdn}], @@ -352,9 +351,9 @@ sub save_conf { my $adsl; my $modem; my $isdn; - $netcnx->{type} =~ /adsl/ and $adsl=$netcnx->{$netcnx->{type}}; - $netcnx->{type} eq 'isdn_external' || $netcnx->{type} eq 'modem' and $modem=$netcnx->{$netcnx->{type}}; - $netcnx->{type} eq 'isdn_internal' and $isdn=$netcnx->{$netcnx->{type}}; + $netcnx->{type} =~ /adsl/ and $adsl = $netcnx->{$netcnx->{type}}; + $netcnx->{type} eq 'isdn_external' || $netcnx->{type} eq 'modem' and $modem = $netcnx->{$netcnx->{type}}; + $netcnx->{type} eq 'isdn_internal' and $isdn = $netcnx->{$netcnx->{type}}; modules::load_category('network/main|usb'); require network::ethernet; network::ethernet->import; @@ -500,7 +499,7 @@ sub add_profile { sub get_profiles { my @a; - my $i=0; + my $i = 0; foreach (glob("/etc/sysconfig/network-scripts/drakconnect_conf.*")) { s/.*\.//; $a[$i] = $_; @@ -511,11 +510,11 @@ sub get_profiles { sub load_conf { my ($netcnx, $netc, $intf)=@_; - my $adsl_pptp={}; - my $adsl_pppoe={}; - my $modem={}; - my $isdn_external={}; - my $isdn={}; + my $adsl_pptp = {}; + my $adsl_pppoe = {}; + my $modem = {}; + my $isdn_external = {}; + my $isdn = {}; my $system_name; my $domain_name; diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 33f3bb6be..c2a1b28cd 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -46,12 +46,12 @@ sub ask_connect_now { my $w = $in->wait_message('', _("Testing your connection..."), 1); connect_backend(); my $s = 30; - $type =~ /modem/ and $s=50; - $type =~ /adsl/ and $s=35; - $type =~ /isdn/ and $s=20; + $type =~ /modem/ and $s = 50; + $type =~ /adsl/ and $s = 35; + $type =~ /isdn/ and $s = 20; sleep $s; my $netc = {}; - $up=connected(); + $up = connected(); } my $m = $up ? (_("The system is now connected to Internet.") . if_($::isInstall, _("For security reason, it will be disconnected now.")) ) : diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index c75a9404d..2425ac466 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -519,7 +519,7 @@ sub readCompssUsers { /^(.*?)\s*\[path=(.*?)\](.*)/ and $_ = "$1$3", $path = $2; /^(.*?)\s*\[icon=(.*?)\](.*)/ and $_ = "$1$3", $icon = $2; /^(.*?)\s*\[descr=(.*?)\](.*)/ and $_ = "$1$3", $descr = $2; - $compssUsers{"$path|$_"} = { label => $_, verbatim => $verbatim, path => $path, icons => $icon, descr => $descr, flags => $l=[] }; + $compssUsers{"$path|$_"} = { label => $_, verbatim => $verbatim, path => $path, icons => $icon, descr => $descr, flags => $l = [] }; push @sorted, "$path|$_"; } elsif (/^\s+(.*?)\s*$/) { push @$l, $1; diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 9ac3d7524..0d24d0eb8 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -754,7 +754,7 @@ sub read_cups_options ($) { } my $i; my $j; - my @args = (); + my @args; my $line; my $inoption = 0; my $inchoices = 0; @@ -833,7 +833,7 @@ sub read_cups_printer_list { local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "lpstat -v |" || return (); - my @printerlist = (); + my @printerlist; my $line; while ($line = ) { if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) { @@ -860,7 +860,7 @@ sub get_cups_remote_queues { local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "lpstat -v |" || return (); - my @printerlist = (); + my @printerlist; my $line; while ($line = ) { if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) { @@ -897,7 +897,7 @@ sub set_cups_autoconf { } # Remove all valid "CUPS_CONFIG" lines - (/^\s*CUPS_CONFIG/ and $_="") foreach @file_content; + (/^\s*CUPS_CONFIG/ and $_ = "") foreach @file_content; # Insert the new "Printcap" line if ($autoconf) { @@ -975,7 +975,7 @@ sub write_cupsd_conf { sub read_printers_conf { my ($printer) = @_; - my $current = undef; + my $current; #- read /etc/cups/printers.conf file. #- according to this code, we are now using the following keys for each queues. @@ -1588,7 +1588,7 @@ sub configure_hpoj { die "Could not open /etc/ptal/$ptaldevice for writing!\n"; # Write file header. - $_=`date`; + $_ = `date`; chomp; print CONFIG "# Added $_ by \"printerdrake\".\n". @@ -2169,7 +2169,7 @@ sub makestarofficeprinterentry { "BitmapColor=$color", $configfile); # Set the default paper size if ($ppd =~ /^\s*\*DefaultPageSize:\s*(\S+)\s*$/m) { - my $papersize=$1; + my $papersize = $1; $configfile = removeentry("$queue.PostScript.$queue", "PageSize=", $configfile); $configfile = removeentry("$queue.PostScript.$queue", @@ -2194,7 +2194,7 @@ sub makeopenofficeprinterentry { my $ppd = cat_("$prefix/etc/foomatic/$queue.ppd"); # "PPD_PageSize" line if ($ppd =~ /^\s*\*DefaultPageSize:\s*(\S+)\s*$/m) { - my $papersize=$1; + my $papersize = $1; $configfile = removeentry($queue, "PPD_PageSize=", $configfile); $configfile = addentry($queue, @@ -2353,7 +2353,7 @@ sub getcupsremotequeues { local *F; open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "lpstat -v |" || return (); - my @printerlist = (); + my @printerlist; my $line; while ($line = ) { if ($line =~ m/^\s*device\s+for\s+([^:\s]+):\s*(\S+)\s*$/) { diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index ba3f7bd60..8900e193a 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -224,7 +224,7 @@ Do you really want to get your printers auto-detected?"), _("Do auto-detection")); $do_auto_detect = ($res eq _("Do auto-detection")); } - my @parport = (); + my @parport; my $menuentries = {}; $in->set_help('setupLocal') if $::isInstall; if ($do_auto_detect) { @@ -1497,7 +1497,7 @@ sub setup_options { # range check of the numerical options. my $windowtitle = "$printer->{currentqueue}{make} $printer->{currentqueue}{model}"; if ($::expert) { - my $driver = undef; + my $driver; if ($driver = $printer->{currentqueue}{driver}) { if ($printer->{currentqueue}{foomatic}) { if ($driver eq 'Postscript') { @@ -2042,7 +2042,7 @@ sub security_check { $in->set_help('securityCheck') if $::isInstall; # Get security level - my $security = undef; + my $security; if ($::isInstall) { $security = $in->{security}; } else { diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm index 81dfb6b3f..5a4810ed3 100644 --- a/perl-install/resize_fat/main.pm +++ b/perl-install/resize_fat/main.pm @@ -1,26 +1,7 @@ -#!/usr/bin/perl - -# DiskDrake -# Copyright (C) 1999 MandrakeSoft (pixel@mandrakesoft.com) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +package resize_fat::main; # $Id$ # This is mainly a perl rewrite of the work of Andrew Clausen (libresize) -package resize_fat::main; # $Id$ - use diagnostics; use strict; diff --git a/perl-install/services.pm b/perl-install/services.pm index 7174048a9..3c06859be 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -186,7 +186,7 @@ sub ask_standalone_gtk { my $W = my_gtk->new(_("Services")); my ($x, $y, $w_popup); my $nopop = sub { $w_popup and $w_popup->destroy }; - my $display = sub { $nopop->(); $_[0] and gtkmove(gtkshow(gtkadd($w_popup=new Gtk::Window (-popup), + my $display = sub { $nopop->(); $_[0] and gtkmove(gtkshow(gtkadd($w_popup = new Gtk::Window (-popup), gtksignal_connect(gtkadd(new Gtk::EventBox(), gtkadd(gtkset_shadow_type(new Gtk::Frame, 'etched_out'), gtkset_justify(new Gtk::Label($_[0]), 0))), @@ -229,7 +229,7 @@ sub ask_standalone_gtk { }}), "@$on_services" =~ /$service/)), map { my $a = $_; gtkpack__(new Gtk::HBox(0,0), gtksignal_connect(new Gtk::Button(_($a)), - clicked => sub { my $c = "service $service " . (lc($a) eq "start" ? "restart" : lc($a)) . " 2>&1"; local $_=`$c`; s/\033\[[^mG]*[mG]//g; + clicked => sub { my $c = "service $service " . (lc($a) eq "start" ? "restart" : lc($a)) . " 2>&1"; local $_ = `$c`; s/\033\[[^mG]*[mG]//g; ($started, $action) = $update_service->($service, $l); $display->($_); } diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw index 08119a6a9..5dbb87c11 100755 --- a/perl-install/standalone/drakgw +++ b/perl-install/standalone/drakgw @@ -26,6 +26,7 @@ use standalone; #- warning, standalone must be loaded very first, for 'expla use common; use detect_devices; use interactive; +use network; use log; use c; use network::netconnect; @@ -351,7 +352,7 @@ ONBOOT=yes #- install and setup the RPM packages my $rpms_to_install; -my %rpm2file = ( iptables => '/sbin/iptables', +my %rpm2file = (iptables => '/sbin/iptables', 'dhcp-server' => '/usr/sbin/dhcpd', bind => '/usr/sbin/named', 'caching-nameserver' => '/var/named/named.local'); @@ -386,14 +387,15 @@ elsif (!grep(/drakgw/, cat_($rc_firewall_generic))) { "); } -output($rc_firewall_drakgw, q(#!/bin/sh +output($rc_firewall_drakgw, sprintf(<<'EOF', $rc_firewall_24, $rc_firewall_24)); +#!/bin/sh KERNELMAJ=`uname -r | sed -e 's,\..*,,'` KERNELMIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'` if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -eq 4 ]; then - [ -x ) . $rc_firewall_24 . ' ] && ' . $rc_firewall_24 . q( + [ -x %s ] && %s fi - )); +EOF chmod 0700, $rc_firewall_drakgw; @@ -568,7 +570,7 @@ sub pur_gtk_mode _("No Internet Connection Sharing has ever been configured."); my $window1 = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel; - $window1->signal_connect ( delete_event => sub { Gtk->exit(0); }); + $window1->signal_connect(delete_event => sub { Gtk->exit(0) }); $window1->set_position(1); $window1->set_title(_("Internet connection sharing configuration")); $window1->border_width(10); @@ -590,13 +592,13 @@ Click on Configure to launch the setup wizard.", $setup_state)); $vbox1->pack_start($bbox1,0,0,0); $bbox1->set_layout(-end); my $button_conf = new Gtk::Button _("Configure"); - $button_conf->signal_connect ( clicked => sub { + $button_conf->signal_connect(clicked => sub { system("/usr/sbin/drakgw --wizard"); kill(USR1, $::CCPID); }); $bbox1->add($button_conf); my $button_cancel = new Gtk::Button _("Cancel"); - $button_cancel->signal_connect ( clicked => sub { + $button_cancel->signal_connect(clicked => sub { kill(USR1, $::CCPID); }); $bbox1->add($button_cancel); @@ -611,6 +613,9 @@ Click on Configure to launch the setup wizard.", $setup_state)); #------------------------------------------------- #- $Log$ +#- Revision 1.63 2002/07/31 11:59:03 prigaux +#- make new perl_checker happy +#- #- Revision 1.62 2002/07/23 10:35:55 tvignaud #- - Big Move 1: interactive::* hierarchy #- diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake index 1160fe758..5085b79ee 100755 --- a/perl-install/standalone/keyboarddrake +++ b/perl-install/standalone/keyboarddrake @@ -18,8 +18,8 @@ local $_ = join '', @ARGV; $::expert = /-expert/; print "[$::expert]\n"; -my $keyboard=''; -if ($::expert) { ($keyboard) = grep { !/^-/ } @ARGV;} +my $keyboard; +if ($::expert) { ($keyboard) = grep { !/^-/ } @ARGV } print "[$keyboard]\n"; my $in = 'interactive'->vnew('su', 'keyboard'); diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake index 0388fd3cd..2399f54bf 100755 --- a/perl-install/standalone/mousedrake +++ b/perl-install/standalone/mousedrake @@ -45,7 +45,6 @@ if (!$mouse || !$::auto) { sub { join '|', map { translate($_) } split '\|', $_[0] }, [ mouse::fullnames ], $mouse->{type} . '|' . $mouse->{name}); - Gtk->timeout_remove($time_tag2) if $::isEmbedded && $in->isa('interactive::gtk'); $name or $::isEmbedded ? do { kill(USR1, $::CCPID); goto begin } : $in->exit(0); my $mouse_chosen = mouse::fullname2mouse($name); $mouse = $mouse_chosen if !($mouse->{type} eq $mouse_chosen->{type} && $mouse->{name} eq $mouse_chosen->{name}); -- cgit v1.2.1