diff options
Diffstat (limited to 'perl-install')
27 files changed, 166 insertions, 168 deletions
diff --git a/perl-install/Xconfig/various.pm b/perl-install/Xconfig/various.pm index 85b90bba0..f02c56c21 100644 --- a/perl-install/Xconfig/various.pm +++ b/perl-install/Xconfig/various.pm @@ -32,7 +32,7 @@ sub info { $info .= N("Monitor: %s\n", $monitor->{ModelName}); $info .= N("Monitor HorizSync: %s\n", $monitor->{HorizSync}) if $::expert; $info .= N("Monitor VertRefresh: %s\n", $monitor->{VertRefresh}) if $::expert; - $info .= N("Graphics card: %s\n", $device->{VendorName} . ' '. $device->{BoardName}); + $info .= N("Graphics card: %s\n", $device->{VendorName} . ' ' . $device->{BoardName}); $info .= N("Graphics memory: %s kB\n", $device->{VideoRam}) if $device->{VideoRam}; if (my $resolution = eval { $raw_X->get_resolution }) { $info .= N("Color depth: %s\n", translate($Xconfig::resolution_and_depth::depth2text{$resolution->{Depth}})); diff --git a/perl-install/bootlook.pm b/perl-install/bootlook.pm index 5a73684bb..2eba6b460 100644 --- a/perl-install/bootlook.pm +++ b/perl-install/bootlook.pm @@ -85,7 +85,7 @@ my $menubar = ugtk::create_factory_menu($window, @menu_items); my $user_combo = new Gtk::Combo; $user_combo->set_popdown_strings(@usernames); $user_combo->entry->set_text($auto_mode{autologin}) if $auto_mode{autologin}; -my $desktop_combo =new Gtk::Combo; +my $desktop_combo = new Gtk::Combo; $desktop_combo->set_popdown_strings(get_wm()); $desktop_combo->entry->set_text($auto_mode{desktop}) if $auto_mode{desktop}; my $a_c_button = new Gtk::RadioButton (N("NewStyle Categorizing Monitor")); @@ -362,7 +362,7 @@ $window->show_all(); $no_bootsplash and $thm_frame->hide(); Gtk->main_iteration while Gtk->events_pending; $::isEmbedded and kill 'USR2', $::CCPID; -$inmain=1; +$inmain = 1; Gtk->main; Gtk->exit(0); @@ -472,7 +472,7 @@ sub get_autologin { } sub updateAutologin { - my ($usern,$deskt)=($user_combo->entry->get_text(), $desktop_combo->entry->get_text()); + my ($usern,$deskt) = ($user_combo->entry->get_text(), $desktop_combo->entry->get_text()); if ($x_yes_button->get_active()) { $in->do_pkgs->install('autologin') if $x_mode; set_autologin('',$usern,$deskt); diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 6ce3a7e86..32c52904c 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -123,7 +123,7 @@ sub entry { "scd" => [ c::S_IFBLK(), 11, 0 ], "ttyS" => [ c::S_IFCHR(), 4, 64 ], "ubd/" => [ c::S_IFBLK(), 98, 0 ], - }}{$1}}; + }}{$1} }; $minor += $2; } unless ($type) { diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm index 5b85116c8..267edd1de 100644 --- a/perl-install/harddrake/sound.pm +++ b/perl-install/harddrake/sound.pm @@ -175,7 +175,7 @@ sub switch { [ { label => N("Driver:"), val => \$new_driver, list => $alternative, default => $new_driver, sort =>1, format => sub { my %des = modules::category2modules_and_description('multimedia/sound'); - "$_[0] (". $des{$_[0]} . ')' + "$_[0] (" . $des{$_[0]} . ')' }, allow_empty_list => 1 }, { val => N("Help"), disabled => sub {}, diff --git a/perl-install/harddrake/v4l.pm b/perl-install/harddrake/v4l.pm index ce944adcb..ee6b488ae 100644 --- a/perl-install/harddrake/v4l.pm +++ b/perl-install/harddrake/v4l.pm @@ -221,7 +221,7 @@ If your card is misdetected, you can force the right tuner and card types here. $conf{card} = $cards_lst->{$driver}{$conf{card}}; my $options = - 'radio=' . ($conf{radio} ? 1 : 0) . ' '. + 'radio=' . ($conf{radio} ? 1 : 0) . ' ' . join(' ', map { if_($conf{$_} ne -1, "$_=$conf{$_}") } qw(card pll tuner gbuffers)); if ($options) { log::l("[harddrake::bttv] $options"); diff --git a/perl-install/http.pm b/perl-install/http.pm index ad05b761e..34158f7bd 100644 --- a/perl-install/http.pm +++ b/perl-install/http.pm @@ -7,7 +7,7 @@ use network; my $sock; sub getFile { - local($^W) = 0; + local ($^W) = 0; my ($url) = @_; $sock->close if $sock; diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 92112f8b8..e8084e8ae 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -466,7 +466,7 @@ sub main { $o->{intf} ||= { $l->{DEVICE} => $l }; } if (-e '/etc/resolv.conf') { - my $file ='/etc/resolv.conf'; + my $file = '/etc/resolv.conf'; log::l("found network config file $file"); add2hash($o->{netc}, network::read_resolv_conf($file)); } @@ -618,7 +618,7 @@ sub main { #- to ensure linuxconf doesn't cry against those files being in the future foreach ('/etc/modules.conf', '/etc/crontab', '/etc/sysconfig/mouse', '/etc/sysconfig/network', '/etc/X11/fs/config') { - my $now = time - 24 * 60 * 60; + my $now = time() - 24 * 60 * 60; utime $now, $now, "$o->{prefix}/$_"; } $::live or install_any::killCardServices(); diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index a0431067b..8e94b6bbe 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -689,7 +689,7 @@ sub kdeicons_postinstall { template2userfile($prefix, "$ENV{SHARE_PATH}/$name.kdelnk.in", - "Desktop/$text" . ($nb && " $nb"). ".kdelnk", + "Desktop/$text" . ($nb && " $nb") . ".kdelnk", 1, %$_) if $name; } diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 20921da72..738cb5290 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -362,12 +362,12 @@ sub installPackages($$) { #- complete REWORK, TODO and TOCHECK! #- small transaction will be built based on this selection and depslist. my @toInstall = pkgs::packagesToInstall($packages); - my $time = time; + my $time = time(); $ENV{DURING_INSTALL} = 1; pkgs::install($o->{prefix}, $o->{isUpgrade}, \@toInstall, $packages); delete $ENV{DURING_INSTALL}; run_program::rooted_or_die($o->{prefix}, 'ldconfig') unless $::g_auto_install; - log::l("Install took: ", formatTimeRaw(time - $time)); + log::l("Install took: ", formatTimeRaw(time() - $time)); install_any::log_sizes($o); scalar(@toInstall); #- return number of packages installed. } diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 299b81ec3..8490e72f3 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -218,7 +218,7 @@ sub selectKeyboard { messages => N("Please choose your keyboard layout."), advanced_messages => N("Here is the full list of keyboards available"), advanced_label => N("More"), - callbacks => { changed => sub { $other = $_[0]==1 } }, + callbacks => { changed => sub { $other = $_[0] == 1 } }, }, [ if_(@best > 1, { val => \$KEYBOARD, type => 'list', format => $format, sort => 1, list => [ @best ] }), diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index b18b3223d..076b11f7d 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -123,7 +123,7 @@ sub exit { exit($_[0]) } #-###################################################################################### sub ask_warn { my ($o, $title, $message) = @_; - local $::isWizard=0; + local $::isWizard = 0; ask_from_listf_no_check($o, $title, $message, undef, [ N("Ok") ]); } diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index b5eea7742..a8f51e2e3 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -212,7 +212,7 @@ LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /usr/sbin/adsl-start $netc->{NET_DEVICE echo 'not yet implemented, still beta software' ", $netc->{adsltype}) } - $netc->{NET_INTERFACE}='ppp0'; + $netc->{NET_INTERFACE} = 'ppp0'; } 1; diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 3754cfd4a..bda415549 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -16,7 +16,7 @@ use MDK::Common::Globals "network", qw($in $prefix); sub configure_cable { my ($netcnx, $netc, $intf, $first_time) = @_; $::isInstall and $in->set_help('configureNetworkCable'); - $netcnx->{type}='cable'; + $netcnx->{type} = 'cable'; # $netcnx->{cable}={}; # $in->ask_from_entries_ref(N("Cable connection"), # N("Please enter your host name if you know it. @@ -38,9 +38,9 @@ sub configure_cable { Default is dhcpcd"), sub { $_[0]{description} }, \@m)) { - $f->{c}==1 and $netcnx->{dhcp_client}="dhcpcd" and $in->do_pkgs->install(qw(dhcpcd)); - $f->{c}==3 and $netcnx->{dhcp_client}="dhcpxd" and $in->do_pkgs->install(qw(dhcpxd)); - $f->{c}==4 and $netcnx->{dhcp_client}="dhcp-client" and $in->do_pkgs->install(qw(dhcp-client)); + $f->{c} == 1 and $netcnx->{dhcp_client} = "dhcpcd" and $in->do_pkgs->install(qw(dhcpcd)); + $f->{c} == 3 and $netcnx->{dhcp_client} = "dhcpxd" and $in->do_pkgs->install(qw(dhcpxd)); + $f->{c} == 4 and $netcnx->{dhcp_client} = "dhcp-client" and $in->do_pkgs->install(qw(dhcp-client)); } } else { $in->do_pkgs->install(qw(dhcpcd)); @@ -63,7 +63,7 @@ sub configure_lan { configureNetwork2($in, $prefix, $netc, $intf); $netc->{NETWORKING} = "yes"; if ($netc->{GATEWAY} || grep { $_->{BOOTPROTO} eq 'dhcp' } values %$intf) { - $netcnx->{type}='lan'; + $netcnx->{type} = 'lan'; $netcnx->{NET_DEVICE} = $netc->{NET_DEVICE} = ''; $netcnx->{NET_INTERFACE} = 'lan'; #$netc->{NET_INTERFACE}; write_cnx_script($netc, "local network", @@ -162,7 +162,7 @@ sub conf_network_card_backend { sub go_ethernet { my ($netc, $intf, $type, $ipadr, $netadr, $first_time) = @_; conf_network_card($netc, $intf, $type, $ipadr, $netadr) or return; - $netc->{NET_INTERFACE}=$netc->{NET_DEVICE}; + $netc->{NET_INTERFACE} = $netc->{NET_DEVICE}; configureNetwork($netc, $intf, $first_time) or return; # if ( $::isStandalone and $netc->{NET_DEVICE}) { # $in->ask_yesorno(N("Network interface"), diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index 8e1c00261..e6997351e 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -23,15 +23,15 @@ sub configure { ) or return; if ($e =~ /card/) { intern_pci: - $netc->{isdntype}='isdn_internal'; - $netcnx->{isdn_internal}={}; + $netc->{isdntype} = 'isdn_internal'; + $netcnx->{isdn_internal} = {}; $netcnx->{isdn_internal}{$_} = $netc->{autodetect}{isdn}{$_} foreach 'description', 'vendor', 'id', 'driver', 'card_type', 'type'; isdn_detect($netcnx->{isdn_internal}, $netc) or return; } else { - $netc->{isdntype}='isdn_external'; - $netcnx->{isdn_external}={}; - $netcnx->{isdn_external}{device}=$netc->{autodetect}{modem}; - $netcnx->{isdn_external}{special_command}='AT&F&O2B40'; + $netc->{isdntype} = 'isdn_external'; + $netcnx->{isdn_external} = {}; + $netcnx->{isdn_external}{device} = $netc->{autodetect}{modem}; + $netcnx->{isdn_external}{special_command} = 'AT&F&O2B40'; require network::modem; network::modem::pppConfig($netcnx->{isdn_external}, $mouse, $netc) or goto isdn_step_1; } @@ -76,7 +76,7 @@ sub isdn_write_config_backend { } else { my $a = ""; defined $isdn->{$_} and $a .= "$_=" . $isdn->{$_} . " " foreach qw(type protocol mem io io0 io1 irq); - $isdn->{driver} eq "hisax" and $a.="id=HiSax"; + $isdn->{driver} eq "hisax" and $a .= "id=HiSax"; modules::set_options($isdn->{driver}, $a); } modules::add_alias("ippp0", $isdn->{driver}); @@ -243,7 +243,7 @@ sub isdn_detect { isdn_ask($isdn, $netc, N("I have detected an ISDN PCI card, but I don't know its type. Please select a PCI card on the next screen.")) or return; } else { isdn_detect_step_1: - $isdn->{protocol}=isdn_ask_protocol() or return; + $isdn->{protocol} = isdn_ask_protocol() or return; isdn_detect_step_2: isdn_ask_info($isdn, $netc) or goto isdn_detect_step_1; isdn_write_config($isdn, $netc) or goto isdn_detect_step_2; @@ -251,7 +251,7 @@ sub isdn_detect { } else { isdn_ask($isdn, $netc, N("No ISDN PCI card found. Please select one on the next screen.")) or return; } - $netc->{$_}='ippp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; + $netc->{$_} = 'ippp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; 1; } diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index 1003cc637..a6eabf170 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -14,9 +14,9 @@ use MDK::Common::Globals "network", qw($in $prefix); sub configure { my ($netcnx, $mouse, $netc) = @_; - $netcnx->{type}='modem'; - $netcnx->{$netcnx->{type}}={}; - $netcnx->{modem}{device}=$netc->{autodetect}{modem}; + $netcnx->{type} = 'modem'; + $netcnx->{$netcnx->{type}} = {}; + $netcnx->{modem}{device} = $netc->{autodetect}{modem}; modem_step_1: pppConfig($netcnx->{$netcnx->{type}}, $mouse, $netc) or return; write_cnx_script($netc, "modem", @@ -33,7 +33,7 @@ killall pppd sub pppConfig { my ($modem, $mouse, $netc) = @_; - $mouse ||={}; + $mouse ||= {}; $mouse->{device} ||= readlink "$prefix/dev/mouse"; $::isInstall and $in->set_help('selectSerialPort'); $modem->{device} ||= $in->ask_from_listf('', N("Please choose which serial port your modem is connected to."), @@ -53,7 +53,7 @@ sub pppConfig { ]) or return; $netc->{DOMAINNAME2} = $modem->{domain}; any::pppConfig($in, $modem, $prefix); - $netc->{$_}='ppp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; + $netc->{$_} = 'ppp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; 1; } diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index c91e39672..007dfbe30 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -46,10 +46,10 @@ sub intro { translate($text), sub { $_[0]{description} }, \@l); - run_program::rooted($prefix, $connect_prog) if $e->{c}==1; - run_program::rooted($prefix, $disconnect_file) if $e->{c}==2; - main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if $e->{c}==3; - $in->exit(0) if $e->{c}==4; + run_program::rooted($prefix, $connect_prog) if $e->{c} == 1; + run_program::rooted($prefix, $disconnect_file) if $e->{c} == 2; + main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if $e->{c} == 3; + $in->exit(0) if $e->{c} == 4; } else { main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0); } @@ -123,11 +123,11 @@ sub init_globals { sub main { my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $direct_fr, $noauto) = @_; init_globals ($in, $prefix); - $netc->{minus_one}=0; #When one configure an eth in dhcp without gateway + $netc->{minus_one} = 0; #When one configure an eth in dhcp without gateway $::isInstall and $in->set_help('configureNetwork'); $::isStandalone and read_net_conf($prefix, $netcnx, $netc); # REDONDANCE with intro. FIXME - $netc->{NET_DEVICE}=$netcnx->{NET_DEVICE} if $netcnx->{NET_DEVICE}; # REDONDANCE with read_conf. FIXME - $netc->{NET_INTERFACE}=$netcnx->{NET_INTERFACE} if $netcnx->{NET_INTERFACE}; # REDONDANCE with read_conf. FIXME + $netc->{NET_DEVICE} = $netcnx->{NET_DEVICE} if $netcnx->{NET_DEVICE}; # REDONDANCE with read_conf. FIXME + $netc->{NET_INTERFACE} = $netcnx->{NET_INTERFACE} if $netcnx->{NET_INTERFACE}; # REDONDANCE with read_conf. FIXME network::read_all_conf($prefix, $netc ||= {}, $intf ||= {}); modules::mergein_conf("$prefix/etc/modules.conf"); @@ -138,7 +138,7 @@ sub main { N("Because you are doing a network installation, your network is already configured. Click on Ok to keep your configuration, or cancel to reconfigure your Internet & Network connection. "), 1)) and do { - $netcnx->{type}='lan'; + $netcnx->{type} = 'lan'; output "$prefix$connect_file", qq( ifup eth0 @@ -154,11 +154,11 @@ ifdown eth0 }; } - $netc->{autodetection}=1; - $netc->{autodetect}={}; + $netc->{autodetection} = 1; + $netc->{autodetect} = {}; step_1: - $::Wizard_no_previous=1; + $::Wizard_no_previous = 1; my @profiles = get_profiles(); $in->ask_from(N("Network Configuration Wizard"), N("Welcome to The Network Configuration Wizard. @@ -272,8 +272,8 @@ N("After this is done, we recommend that you restart your X environment to avoid N("Problems occured during configuration. Test your connection via net_monitor or mcc. If your connection doesn't work, you might want to relaunch the configuration."); if ($::isWizard) { - $::Wizard_no_previous=1; - $::Wizard_finished=1; + $::Wizard_no_previous = 1; + $::Wizard_finished = 1; $in->ask_okcancel(N("Network Configuration"), $m, 1); undef $::Wizard_no_previous; undef $::Wizard_finished; @@ -327,7 +327,7 @@ fi ); } chmod 0755, "$prefix$connect_prog"; - $netcnx->{$_}=$netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE); + $netcnx->{$_} = $netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE); $netcnx->{NET_INTERFACE} and set_net_conf($netcnx, $netc); $netcnx->{type} =~ /adsl/ or system("/sbin/chkconfig --del adsl 2> /dev/null"); @@ -354,7 +354,7 @@ fi } sub save_conf { - my ($netcnx, $netc, $intf)=@_; + my ($netcnx, $netc, $intf) = @_; my $adsl; my $modem; my $isdn; @@ -471,7 +471,7 @@ sub set_profile { $profile or return; my $f = "$prefix/etc/sysconfig/network-scripts/drakconnect_conf"; -e ($f . "." . $profile) or return; - $netcnx->{PROFILE}=$profile; + $netcnx->{PROFILE} = $profile; cp_af($f . "." . $profile, $f); foreach (["$prefix$connect_file", "up"], ["$prefix$disconnect_file", "down"], @@ -511,7 +511,7 @@ sub get_profiles { } sub load_conf { - my ($netcnx, $netc, $intf)=@_; + my ($netcnx, $netc, $intf) = @_; my $adsl_pptp = {}; my $adsl_pppoe = {}; my $modem = {}; @@ -574,14 +574,14 @@ sub load_conf { /^DOMAINNAME2=(.*)$/ and $netc->{DOMAINNAME2} = $1; } } - $system_name && $domain_name and $netc->{HOSTNAME}=join ('.', $system_name, $domain_name); - $adsl_pptp->{$_}=$adsl_pppoe->{$_} foreach 'login', 'passwd', 'passwd2'; - $isdn_external->{$_}=$modem->{$_} foreach 'device', 'connection', 'phone', 'domain', 'dns1', 'dns2', 'login', 'passwd', 'auth'; - $netcnx->{adsl_pptp}=$adsl_pptp; - $netcnx->{adsl_pppoe}=$adsl_pppoe; - $netcnx->{modem}=$modem; - $netcnx->{modem}=$isdn_external; - $netcnx->{isdn_internal}=$isdn; + $system_name && $domain_name and $netc->{HOSTNAME} = join ('.', $system_name, $domain_name); + $adsl_pptp->{$_} = $adsl_pppoe->{$_} foreach 'login', 'passwd', 'passwd2'; + $isdn_external->{$_} = $modem->{$_} foreach 'device', 'connection', 'phone', 'domain', 'dns1', 'dns2', 'login', 'passwd', 'auth'; + $netcnx->{adsl_pptp} = $adsl_pptp; + $netcnx->{adsl_pppoe} = $adsl_pppoe; + $netcnx->{modem} = $modem; + $netcnx->{modem} = $isdn_external; + $netcnx->{isdn_internal} = $isdn; -e "$prefix/etc/sysconfig/network" and put_in_hash($netc, network::read_conf("$prefix/etc/sysconfig/network")); foreach (glob_("$prefix/etc/sysconfig/ifcfg-*")) { my $l = network::read_interface_conf($_); @@ -607,15 +607,15 @@ sub get_net_device { } sub read_net_conf { - my ($prefix, $netcnx, $netc)=@_; + my ($prefix, $netcnx, $netc) = @_; add2hash($netcnx, { read_raw_net_conf('_conf') }); $netc->{$_} = $netcnx->{$_} foreach 'NET_DEVICE', 'NET_INTERFACE'; - $netcnx->{$netcnx->{type}}||={}; + $netcnx->{$netcnx->{type}} ||= {}; add2hash($netcnx->{$netcnx->{type}}, { read_raw_net_conf($netcnx->{type}) }); } sub set_net_conf { - my ($netcnx, $netc)=@_; + my ($netcnx, $netc) = @_; setVarsInShMode("$prefix/etc/sysconfig/drakconnect", 0600, $netcnx, "NET_DEVICE", "NET_INTERFACE", "type", "PROFILE"); setVarsInShMode("$prefix/etc/sysconfig/drakconnect." . $netcnx->{type}, 0600, $netcnx->{$netcnx->{type}}); #- doesn't work, don't know why setVarsInShMode("$prefix/etc/sysconfig/drakconnect.netc", 0600, $netc); #- doesn't work, don't know why diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 3c4a75895..79884887a 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -269,7 +269,7 @@ sub configureNetworkIntf { my @wireless_modules = qw(aironet_cs aironet4500_cs hermes airo orinoco_cs orinoco airo_cs netwave_cs ray_cs wavelan_cs wvlan_cs airport); my $flag = 0; foreach (@wireless_modules) { - $module =~ /$_/ and $flag =1; + $module =~ /$_/ and $flag = 1; } if ($flag) { $intf->{wireless_eth} = 1; @@ -305,7 +305,7 @@ notation (for example, 1.2.3.4)."); my @fields = qw(IPADDR NETMASK); $::isStandalone or $in->set_help('configureNetworkIP'); $in->ask_from(N("Configuring network device %s", $intf->{DEVICE}), - (N("Configuring network device %s", $intf->{DEVICE}) . ($module ? N(" (driver %s)", $module) : '') ."\n\n") . + (N("Configuring network device %s", $intf->{DEVICE}) . ($module ? N(" (driver %s)", $module) : '') . "\n\n") . $text, [ { label => N("IP address"), val => \$intf->{IPADDR}, disabled => sub { $pump } }, { label => N("Netmask"), val => \$intf->{NETMASK}, disabled => sub { $pump } }, diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index c7f337da4..88cacba9d 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -14,7 +14,7 @@ use MDK::Common::System qw(getVarsFromSh); sub write_cnx_script { my ($netc, $type, $up, $down, $type2) = @_; if ($type) { - $netc->{internet_cnx}{$type}{$_->[0]}=$_->[1] foreach [$connect_file, $up], [$disconnect_file, $down]; + $netc->{internet_cnx}{$type}{$_->[0]} = $_->[1] foreach [$connect_file, $up], [$disconnect_file, $down]; $netc->{internet_cnx}{$type}{type} = $type2; } else { foreach ($connect_file, $disconnect_file) { @@ -36,7 +36,7 @@ sub write_secret_backend { sub ask_connect_now { my ($type) = @_; - $::Wizard_no_previous=1; + $::Wizard_no_previous = 1; #- FIXME : code the exception to be generated by ask_yesorno, to be able to remove the $::Wizard_no_previous=1; if ($in->ask_yesorno(N("Internet configuration"), N("Do you want to try to connect to the Internet now?") @@ -58,8 +58,8 @@ sub ask_connect_now { N("The system doesn't seem to be connected to internet. Try to reconfigure your connection."); if ($::isWizard) { - $::Wizard_no_previous=1; - $::Wizard_finished=1; + $::Wizard_no_previous = 1; + $::Wizard_finished = 1; $in->ask_okcancel(N("Network Configuration"), $m, 1); undef $::Wizard_no_previous; undef $::Wizard_finished; @@ -128,7 +128,7 @@ sub detect_timezone { sub type2interface { my ($i) = @_; - $i=~/$_->[0]/ and return $_->[1] foreach [ modem => 'ppp'], + $i =~ /$_->[0]/ and return $_->[1] foreach [ modem => 'ppp'], [ isdn_internal => 'ippp'], [ isdn_external => 'ppp'], [ adsl => 'ppp'], @@ -140,7 +140,7 @@ sub connected { gethostbyname("mandrakesoft.com") ? 1 : 0 } my $kid_pipe; sub connected_bg { - local $|=1; + local $| = 1; my ($ref) = @_; if (defined $kid_pipe) { local *F; @@ -169,7 +169,7 @@ my $kid_pid; my $current_connection_status; sub test_connected { - local $|=1; + local $| = 1; my ($cmd) = @_; if (!defined $current_connection_status) { $current_connection_status = -1 } diff --git a/perl-install/partition_table/mac.pm b/perl-install/partition_table/mac.pm index 131dcb72f..7fd442d8f 100644 --- a/perl-install/partition_table/mac.pm +++ b/perl-install/partition_table/mac.pm @@ -128,7 +128,7 @@ sub read($$) { c::lseek_sector(fileno(F), $sector, 512) or die "reading of partition in sector $sector failed"; my @pt; - for (my $i=0;$i<$partmapsize;$i++) { + for (my $i = 0;$i < $partmapsize;$i++) { my $part; sysread F, $part, psizeof($p_format) or die "error while reading partition info in sector $sector"; diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index aae42dfbd..21d03a920 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -81,7 +81,7 @@ sub extractHeaders { } foreach (@$pkgs) { - my $f = "$prefix/tmp/headers/". $_->header_filename; + my $f = "$prefix/tmp/headers/" . $_->header_filename; $_->update_header($f) or log::l("unable to open header file $f"), next; log::l("read header file $f"); } @@ -190,7 +190,7 @@ sub packagesToInstall { log::l("examining packagesToInstall of medium $_->{descr}"); push @packages, grep { $_->flag_selected } packagesOfMedium($packages, $_); } - log::l("found " .scalar(@packages). " packages to install"); + log::l("found " . scalar(@packages) . " packages to install"); @packages; } @@ -749,7 +749,7 @@ sub rpmDbOpen { my $rebuilddb_dir = "$prefix/var/lib/rpmrebuilddb.$$"; -d $rebuilddb_dir and log::l("removing stale directory $rebuilddb_dir"), rm_rf($rebuilddb_dir); - URPM::DB::rebuild($prefix) or log::l("rebuilding of rpm database failed: ". c::rpmErrorString()), c::_exit(2); + URPM::DB::rebuild($prefix) or log::l("rebuilding of rpm database failed: " . c::rpmErrorString()), c::_exit(2); c::_exit(0); } @@ -988,7 +988,7 @@ sub install($$$;$$) { log::l("opened rpm database for retry transaction of 1 package only"); $trans->add($retry_pkg, $isUpgrade && allowedToUpgrade($retry_pkg->name)); } else { - log::l("opened rpm database for transaction of ". scalar @transToInstall . + log::l("opened rpm database for transaction of " . scalar @transToInstall . " new packages, still $nb after that to do"); $trans->add($_, $isUpgrade && allowedToUpgrade($_->name)) foreach @transToInstall; @@ -1073,7 +1073,7 @@ sub install($$$;$$) { log::l("retrying installing package ".$retry_pkg->fullname." alone in a transaction"); --$retry_count; } else { - log::l("bad package ". $retry_pkg->fullname ." unable to be installed"); + log::l("bad package " . $retry_pkg->fullname . " unable to be installed"); $retry_pkg->set_flag_requested(0); $retry_pkg->set_flag_required(0); #- keep name to display (problem of displaying ?). diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index b9e536d61..06329bdfc 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -191,7 +191,7 @@ sub getinfo($) { my $printer = {}; my @QUEUES; - $::prefix=$prefix; + $::prefix = $prefix; # Initialize $printer data structure resetinfo($printer); @@ -1007,8 +1007,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); @@ -1462,38 +1461,38 @@ sub configure_hpoj { $_ = `date`; chomp; print CONFIG - "# Added $_ by \"printerdrake\".\n". - "\n". - "# The basic format for this file is \"key[+]=value\".\n". - "# If you say \"+=\" instead of \"=\", then the value is appended to any\n". - "# value already defined for this key, rather than replacing it.\n". - "\n". - "# Comments must start at the beginning of the line. Otherwise, they may\n". - "# be interpreted as being part of the value.\n". - "\n". - "# If you have multiple devices and want to define options that apply to\n". - "# all of them, then put them in the file /etc/ptal/defaults, which is read\n". - "# in before this file.\n". - "\n". - "# The format version of this file:\n". - "# ptal-init ignores devices with incorrect/missing versions.\n". + "# Added $_ by \"printerdrake\".\n" . + "\n" . + "# The basic format for this file is \"key[+]=value\".\n" . + "# If you say \"+=\" instead of \"=\", then the value is appended to any\n" . + "# value already defined for this key, rather than replacing it.\n" . + "\n" . + "# Comments must start at the beginning of the line. Otherwise, they may\n" . + "# be interpreted as being part of the value.\n" . + "\n" . + "# If you have multiple devices and want to define options that apply to\n" . + "# all of them, then put them in the file /etc/ptal/defaults, which is read\n" . + "# in before this file.\n" . + "\n" . + "# The format version of this file:\n" . + "# ptal-init ignores devices with incorrect/missing versions.\n" . "init.version=1\n"; # Write model string. if ($model_long !~ /\S/) { print CONFIG - "\n". - "# \"printerdrake\" couldn't read the model but added this device anyway:\n". + "\n" . + "# \"printerdrake\" couldn't read the model but added this device anyway:\n" . "# "; } else { print CONFIG - "\n". - "# The device model that was originally detected on this port:\n". - "# If this ever changes, then you should re-run \"printerdrake\"\n". + "\n" . + "# The device model that was originally detected on this port:\n" . + "# If this ever changes, then you should re-run \"printerdrake\"\n" . "# to delete and re-configure this device.\n"; if ($bus eq "par") { print CONFIG - "# Comment out if you don't care what model is really connected to this\n". + "# Comment out if you don't care what model is really connected to this\n" . "# parallel port.\n"; } } @@ -1501,16 +1500,16 @@ sub configure_hpoj { "init.mlcd.append+=-devidmatch \"$model_long\"\n"; # Write serial-number string. - if ($serialnumber_long!~/\S/) { + if ($serialnumber_long !~ /\S/) { print CONFIG - "\n". - "# The device's serial number is unknown.\n". + "\n" . + "# The device's serial number is unknown.\n" . "# "; } else { print CONFIG - "\n". + "\n" . "# The serial number of the device that was originally detected on this port:\n"; - if ($bus=~/^[pu]/) { + if ($bus =~ /^[pu]/) { print CONFIG "# Comment out if you want to disable serial-number matching.\n"; } @@ -1518,10 +1517,10 @@ sub configure_hpoj { print CONFIG "init.mlcd.append+=-devidmatch \"$serialnumber_long\"\n"; - if ($bus=~/^[pu]/) { + if ($bus =~ /^[pu]/) { print CONFIG - "\n". - "# Standard options passed to ptal-mlcd:\n". + "\n" . + "# Standard options passed to ptal-mlcd:\n" . "init.mlcd.append+="; if ($bus eq "usb") { # Important: don't put more quotes around /dev/usb/lp[0-9]*, @@ -1530,46 +1529,46 @@ sub configure_hpoj { } elsif ($bus eq "par") { print CONFIG "$address_arg -device $device"; } - print CONFIG "\n". - "\n". - "# ptal-mlcd's remote console can be useful for debugging, but may be a\n". - "# security/DoS risk otherwise. In any case, it's accessible with the\n". - "# command \"ptal-connect mlc:<XXX>:<YYY> -service PTAL-MLCD-CONSOLE\".\n". - "# Uncomment the following line if you want to enable this feature for\n". - "# this device:\n". - "# init.mlcd.append+=-remconsole\n". - "\n". - "# If you need to pass any other command-line options to ptal-mlcd, then\n". - "# add them to the following line and uncomment the line:\n". - "# init.mlcd.append+=\n". - "\n". - "# By default ptal-printd is started for mlc: devices. If you use CUPS,\n". - "# then you may not be able to use ptal-printd, and you can uncomment the\n". - "# following line to disable ptal-printd for this device:\n". + print CONFIG "\n" . + "\n" . + "# ptal-mlcd's remote console can be useful for debugging, but may be a\n" . + "# security/DoS risk otherwise. In any case, it's accessible with the\n" . + "# command \"ptal-connect mlc:<XXX>:<YYY> -service PTAL-MLCD-CONSOLE\".\n" . + "# Uncomment the following line if you want to enable this feature for\n" . + "# this device:\n" . + "# init.mlcd.append+=-remconsole\n" . + "\n" . + "# If you need to pass any other command-line options to ptal-mlcd, then\n" . + "# add them to the following line and uncomment the line:\n" . + "# init.mlcd.append+=\n" . + "\n" . + "# By default ptal-printd is started for mlc: devices. If you use CUPS,\n" . + "# then you may not be able to use ptal-printd, and you can uncomment the\n" . + "# following line to disable ptal-printd for this device:\n" . "# init.printd.start=0\n"; } else { print CONFIG - "\n". - "# By default ptal-printd isn't started for hpjd: devices.\n". - "# If for some reason you want to start it for this device, then\n". - "# uncomment the following line:\n". + "\n" . + "# By default ptal-printd isn't started for hpjd: devices.\n" . + "# If for some reason you want to start it for this device, then\n" . + "# uncomment the following line:\n" . "init.printd.start=1\n"; } print CONFIG - "\n". - "# If you need to pass any additional command-line options to ptal-printd,\n". - "# then add them to the following line and uncomment the line:\n". + "\n" . + "# If you need to pass any additional command-line options to ptal-printd,\n" . + "# then add them to the following line and uncomment the line:\n" . "# init.printd.append+=\n"; if ($cardreader) { print CONFIG - "\n". - "# Uncomment the following line to enable ptal-photod for this device:\n". - "init.photod.start=1\n". - "\n". - "# If you have more than one photo-card-capable peripheral and you want to\n". - "# assign particular TCP port numbers and mtools drive letters to each one,\n". - "# then change the line below to use the \"-portoffset <n>\" option.\n". + "\n" . + "# Uncomment the following line to enable ptal-photod for this device:\n" . + "init.photod.start=1\n" . + "\n" . + "# If you have more than one photo-card-capable peripheral and you want to\n" . + "# assign particular TCP port numbers and mtools drive letters to each one,\n" . + "# then change the line below to use the \"-portoffset <n>\" option.\n" . "init.photod.append+=-maxaltports 26\n"; } close(CONFIG); diff --git a/perl-install/printer/office.pm b/perl-install/printer/office.pm index 01f1476da..ce00489a5 100644 --- a/perl-install/printer/office.pm +++ b/perl-install/printer/office.pm @@ -97,7 +97,7 @@ sub configureoffice { # the "Generic Printer" my @parameters = $suites{$suite}{param}; $configfilecontent = removeentry(@parameters, $configfilecontent); - $configfilecontent =addentry($parameters[0], $parameters[1] . $suites{$suite}{perl} . $printer::data::lprcommand{$printer->{SPOOLER}{print_command}}, $configfilecontent); + $configfilecontent = addentry($parameters[0], $parameters[1] . $suites{$suite}{perl} . $printer::data::lprcommand{$printer->{SPOOLER}{print_command}}, $configfilecontent); # Write back Star Office configuration file return writesofficeconfigfile($configfilename, $configfilecontent); } @@ -192,21 +192,21 @@ sub makestarofficeprinterentry { my ($printer, $queue, $configprefix, $configfile) = @_; # Set default printer if ($queue eq $printer->{DEFAULT}) { - $configfile =removeentry("windows", "device=", $configfile); - $configfile =addentry("windows", + $configfile = removeentry("windows", "device=", $configfile); + $configfile = addentry("windows", "device=$queue,$queue PostScript,$queue", $configfile); } # Make an entry in the "[devices]" section - $configfile =removeentry("devices", "$queue=", $configfile); - $configfile =addentry("devices", + $configfile = removeentry("devices", "$queue=", $configfile); + $configfile = addentry("devices", "$queue=$queue PostScript,$queue", $configfile); # Make an entry in the "[ports]" section # The "perl" command patches the PostScript output to print the Euro # symbol correctly. - $configfile =removeentry("ports", "$queue=", $configfile); - $configfile =addentry("ports", + $configfile = removeentry("ports", "$queue=", $configfile); + $configfile = addentry("ports", "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$printer::data::lprcommand{$printer->{SPOOLER}{print_command}} -P $queue", $configfile); # Make printer's section @@ -219,21 +219,21 @@ sub makestarofficeprinterentry { $pslevel = $1; $pslevel = "2" if $pslevel eq "3"; } else { $pslevel = "2" } - $configfile =removeentry("$queue.PostScript.$queue", + $configfile = removeentry("$queue.PostScript.$queue", "Level=", $configfile); - $configfile =addentry("$queue.PostScript.$queue", + $configfile = addentry("$queue.PostScript.$queue", "Level=$pslevel", $configfile); # Set Color/BW my $color = ($ppd =~ /^\s*\*ColorDevice:\s*\"?([Tt]rue)\"?\s*$/m) ? "1" : "0"; - $configfile =removeentry("$queue.PostScript.$queue", "BitmapColor=", $configfile); - $configfile =addentry("$queue.PostScript.$queue", "BitmapColor=$color", $configfile); + $configfile = removeentry("$queue.PostScript.$queue", "BitmapColor=", $configfile); + $configfile = addentry("$queue.PostScript.$queue", "BitmapColor=$color", $configfile); # Set the default paper size if ($ppd =~ /^\s*\*DefaultPageSize:\s*(\S+)\s*$/m) { my $papersize = $1; - $configfile =removeentry("$queue.PostScript.$queue", "PageSize=", $configfile); - $configfile =removeentry("$queue.PostScript.$queue", "PPD_PageSize=", $configfile); - $configfile =addentry("$queue.PostScript.$queue", "PageSize=$papersize", $configfile); - $configfile =addentry("$queue.PostScript.$queue", "PPD_PageSize=$papersize", $configfile); + $configfile = removeentry("$queue.PostScript.$queue", "PageSize=", $configfile); + $configfile = removeentry("$queue.PostScript.$queue", "PPD_PageSize=", $configfile); + $configfile = addentry("$queue.PostScript.$queue", "PageSize=$papersize", $configfile); + $configfile = addentry("$queue.PostScript.$queue", "PPD_PageSize=$papersize", $configfile); } # Link the PPD file run_program::rooted($::prefix, @@ -267,7 +267,7 @@ sub makeopenofficeprinterentry { $configfile = removeentry($queue, "Comment=", $configfile); if (($printer->{configured}{$queue}) && ($printer->{configured}{$queue}{queuedata}{desc})) { - $configfile =addentry + $configfile = addentry ($queue, "Comment=$printer->{configured}{$queue}{queuedata}{desc}", $configfile); diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index 6c2fb76fc..c4ef448c1 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -1109,7 +1109,7 @@ sub setup_socket { join '', ("socket://$remotehost", $remoteport ? (":$remoteport") : ()); #- LPD and LPRng need netcat ('nc') to access to socket printers - if ((($printer->{SPOOLER} eq 'lpd') || ($printer->{SPOOLER} eq 'lprng'))&& + if ((($printer->{SPOOLER} eq 'lpd') || ($printer->{SPOOLER} eq 'lprng')) && (!$::testing) && (!files_exist((qw(/usr/bin/nc))))) { $in->do_pkgs->install('nc'); @@ -2068,12 +2068,12 @@ You should make sure that the page size and the ink type/printing mode (if avail my $j; for ($j = 0; $j <= $#{$choicelists[$i]}; $j++) { if ($choicelists[$i][$j] eq $userinputs[$i]) { - push(@{$printer->{currentqueue}{options}}, $printer->{ARGS}[$i]{name} . "=". $shortchoicelists[$i][$j]); + push(@{$printer->{currentqueue}{options}}, $printer->{ARGS}[$i]{name} . "=" . $shortchoicelists[$i][$j]); } } } elsif ($printer->{ARGS}[$i]{type} eq 'bool') { # boolean option - push(@{$printer->{currentqueue}{options}}, $printer->{ARGS}[$i]{name} . "=". + push(@{$printer->{currentqueue}{options}}, $printer->{ARGS}[$i]{name} . "=" . (($choicelists[$i][0] eq $userinputs[$i]) ? "1" : "0")); } else { # numerical option @@ -3447,8 +3447,7 @@ What do you want to modify on this printer?", #- URI) if ($printer->{configured}{$queue}) { foreach my $type (qw(file lpd socket smb ncp postpipe)) { - if ($printer->{currentqueue}{connect} - =~ /^$type:/) { + if ($printer->{currentqueue}{connect} =~ /^$type:/) { $printer->{TYPE} = ($type eq 'file' ? 'LOCAL' : uc($type)); last; diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm index ba6ac1bc7..216739faf 100644 --- a/perl-install/resize_fat/main.pm +++ b/perl-install/resize_fat/main.pm @@ -121,13 +121,13 @@ sub resize { $size >= $min or die "Minimum filesystem size is $min sectors"; $size <= $max or die "Maximum filesystem size is $max sectors"; - log::l("resize_fat: Partition size will be ". ($size * $SECTORSIZE >> 20) ."Mb (well exactly ${size} sectors)"); + log::l("resize_fat: Partition size will be " . ($size * $SECTORSIZE >> 20) . "Mb (well exactly ${size} sectors)"); my $new_data_size = $size * $SECTORSIZE - $fs->{cluster_offset}; my $new_nb_clusters = divide($new_data_size, $fs->{cluster_size}); my $used_size = used_size($fs); - log::l("resize_fat: Break point for moving files is ". ($used_size * $SECTORSIZE >> 20) ." Mb ($used_size sectors)"); + log::l("resize_fat: Break point for moving files is " . ($used_size * $SECTORSIZE >> 20) . " Mb ($used_size sectors)"); if ($size < $used_size) { log::l("resize_fat: Allocating new clusters"); resize_fat::fat::allocate_remap($fs, $new_nb_clusters); diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm index 6e8ecfa7d..565a7d460 100755 --- a/perl-install/scanner.pm +++ b/perl-install/scanner.pm @@ -182,7 +182,7 @@ sub updateScannerDBfromSane { model => sub { unless ($name) { $name = $val; next } $name = (member($mfg, keys %$sane2DB)) ? - (ref $sane2DB->{ $mfg}) ? $sane2DB->{ $mfg}($name) : "$sane2DB->{ $mfg }|$name" : "$mfg|$name"; + (ref $sane2DB->{$mfg}) ? $sane2DB->{$mfg}($name) : "$sane2DB->{ $mfg }|$name" : "$mfg|$name"; if (member($name, keys %$scanner::scannerDB)) { print "#[$name] already in ScannerDB!\n"; } else { @@ -200,7 +200,7 @@ sub updateScannerDBfromSane { s/\s+$//; /^\;/ and next; ($cmd, $val) = /:(\S+)\s*\"([^\;]*)\"/ or next; #log::l("bad line $lineno ($_)"), next; - my $f = $fs->{ $cmd}; + my $f = $fs->{$cmd}; $f ? $f->() : log::l("unknown line $lineno ($_)"); } $fs->{model}(); # the last one diff --git a/perl-install/steps.pm b/perl-install/steps.pm index 1f74e282b..ee6530ee0 100644 --- a/perl-install/steps.pm +++ b/perl-install/steps.pm @@ -40,7 +40,7 @@ if_((arch() !~ /alpha/) && (arch() !~ /ppc/), $h{entered} = 0; $h{onError} = $installSteps[$i + 2 * $h{onError}]; $h{reachable} = !$h{needs}; - $installSteps{ $installSteps[$i]} = \%h; + $installSteps{$installSteps[$i]} = \%h; push @orderedInstallSteps, $installSteps[$i]; } $installSteps{first} = $installSteps[0]; diff --git a/perl-install/ugtk.pm b/perl-install/ugtk.pm index 782002c8b..d615421b7 100644 --- a/perl-install/ugtk.pm +++ b/perl-install/ugtk.pm @@ -623,7 +623,7 @@ sub n_line_size { } sub write_on_pixmap { - my ($pixmap, $x_pos, $y_pos, @text)=@_; + my ($pixmap, $x_pos, $y_pos, @text) = @_; my ($gdkpixmap, undef) = $pixmap->get(); my ($width, $height) = (440, 250); my $gc = Gtk::Gdk::GC->new(gtkroot()); |