diff options
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/drakautoinst | 14 | ||||
-rwxr-xr-x | perl-install/standalone/drakbug | 10 | ||||
-rwxr-xr-x | perl-install/standalone/drakclock | 4 | ||||
-rwxr-xr-x | perl-install/standalone/drakfont | 4 | ||||
-rwxr-xr-x | perl-install/standalone/draksec | 12 | ||||
-rwxr-xr-x | perl-install/standalone/draksound | 2 | ||||
-rwxr-xr-x | perl-install/standalone/drakups | 12 | ||||
-rwxr-xr-x | perl-install/standalone/fileshareset | 4 | ||||
-rwxr-xr-x | perl-install/standalone/interactive_http/interactive_http.cgi | 23 | ||||
-rwxr-xr-x | perl-install/standalone/notify-x11-free-driver-switch | 2 | ||||
-rwxr-xr-x | perl-install/standalone/scannerdrake | 67 | ||||
-rwxr-xr-x | perl-install/standalone/service_harddrake | 2 |
12 files changed, 71 insertions, 85 deletions
diff --git a/perl-install/standalone/drakautoinst b/perl-install/standalone/drakautoinst index 5ea9427d5..e1d27a72a 100755 --- a/perl-install/standalone/drakautoinst +++ b/perl-install/standalone/drakautoinst @@ -185,10 +185,10 @@ if (!$::isEmbedded && $in->isa('interactive::gtk')) { my $local_page = $nb_pages; my $function = sub { $notebook->set_current_page($local_page) }; gtksignal_connect($button, toggled => sub { - $button->get_active and $function->() + $button->get_active and $function->(); }); my $b; - if ($_->[1] ne "") { $b = gtkcreate_img($_->[1]) } else { undef $b }; + if ($_->[1] ne "") { $b = gtkcreate_img($_->[1]) } else { undef $b } gtksignal_connect(gtkadd($button, gtkpack__(Gtk2::VBox->new(0,3), $b, @@ -200,9 +200,9 @@ if (!$::isEmbedded && $in->isa('interactive::gtk')) { $button->set_active(1); $box->{active_function} = $function; $function->(); - }) + }); } @{$tree{$_}} - ) + ); } keys(%tree) ) ), @@ -296,7 +296,7 @@ sub h2widget { } else { $w = create_packtable({ col_spacings => 10, row_spacings => 3 }, map { create_entry_element($k->{$_}, "$label\{$_}", $_) } @list_keys - ) + ); } } elsif (ref($k) =~ /ARRAY/) { my $vb; @@ -341,7 +341,7 @@ sub create_entry_element { eval $exe; }); } - [ $label ? "$label : " : "" , $e ] + [ $label ? "$label : " : "" , $e ]; } sub control_buttons { @@ -366,5 +366,5 @@ sub control_buttons { $i >= 0 or $button_remove->set_sensitive(0); } ) - ) + ); } diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug index 0c20313e8..a6adb6c5a 100755 --- a/perl-install/standalone/drakbug +++ b/perl-install/standalone/drakbug @@ -116,7 +116,7 @@ sub is_a_boot_issue() { sub format_trace_with_message { my ($message, $trace) = @_; - ([ $message ], [ "\n\n " . join("\n ", split("\n", $trace)) . "\n\n", { family => 'monospace' }]); + ([ $message ], [ "\n\n " . join("\n ", split("\n", $trace)) . "\n\n", { family => 'monospace' } ]); } my @commands = 'lspcidrake -v'; @@ -144,7 +144,7 @@ gtkadd($window->{window}, [ N("Used theme: %s", $theme_name) . "\n\n" ], [ N("To submit a bug report, click on the report button. \nThis will open a web browser window on %s where you'll find a form to fill in. The information displayed above will be transferred to that server", - $wizard_name). "\n" . + $wizard_name) . "\n" . P("It would be very useful to attach to your report the output of the following command: %s.", "Things useful to attach to your report are the output of the following commands: %s.", scalar(@commands), @@ -193,7 +193,7 @@ $button_pkg->signal_connect('clicked', sub { $package->set_text($pkg_name); }); -$button_browse->signal_connect('file-set', sub { $com_app->set_text($button_browse->get_filename()) }); +$button_browse->signal_connect('file-set', sub { $com_app->set_text($button_browse->get_filename) }); $window->{window}->show_all; $window->main; @@ -260,7 +260,7 @@ sub report_bug_to_bugzilla() { $cpuinfo = $1; } my $arch = arch(); - $arch = 'i586' if arch =~ /^i.86/; + $arch = 'i586' if arch() =~ /^i.86/; my $options = join('&', ($product || $version ? 'cf_rpmpkg=' . join('-', $product, $version) : ()), 'version=' . ($rel_data->{branch} eq 'Devel' ? 'Cauldron' : $rel_data->{version}), @@ -277,7 +277,7 @@ sub report_bug_to_bugzilla() { qq(The "$prog" program crashed. Drakbug-$rel caught it. ) . ($text || "Please describe what you were doing when it crashed.") . "\n\n" - . ($error ? $error : + . ($error || qq(If you can, try to run the "$prog" program from a terminal and copy and paste here any error messages and/or backtrace)) ) . qq( diff --git a/perl-install/standalone/drakclock b/perl-install/standalone/drakclock index 7b13dd764..482548d38 100755 --- a/perl-install/standalone/drakclock +++ b/perl-install/standalone/drakclock @@ -93,7 +93,7 @@ $my_win->{window}->add(gtknew('VBox', border_width => $::isEmbedded ? 0 : 5, chi 1, gtknew('Frame', text => N("Timezone"), shadow_type => 'etched_in', child => gtknew('VBox', border_width => 5, children_tight => [ $label_timezone, - $button_time])), + $button_time ])), ]), ]), 0, create_okcancel(my $w = @@ -168,7 +168,7 @@ $time_box->set_direction('ltr'); my $servers = get_server(); $combo_ntpserver->set_popdown_strings(@$servers); -if (-e $ntpfile && ( -e $ntpdsystemdlock || -e $ntpdlock)) { +if (-e $ntpfile && (-e $ntpdsystemdlock || -e $ntpdlock)) { $ntp = timezone::ntp_server(); $ntp and ntp_widget_state(1); my $fullntp = $ntp; diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index f9337cb93..3e4212984 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -373,7 +373,7 @@ sub put_font_dir() { my $dir = "$drakfont_dir/$subdir"; move_fonts("$drakfont_dir/tmp/tmp", "../../$subdir", $subdir); run_program::run($_, $dir) foreach qw(mkfontscale mkfontdir), $fccache; - symlinkf($dir, '/etc/X11/fontpath.d/drakfont_' . basename ($dir)); + symlinkf($dir, '/etc/X11/fontpath.d/drakfont_' . basename($dir)); } interactive_progress($pbar2, 1, N("done")); @@ -519,7 +519,7 @@ sub help() { $license =~ s/\n/\n\n/sg; # nicer formatting my $w = gtknew('AboutDialog', name => N("Drakfont"), version => mageia_release_info()->{version}, - copyright => N("Copyright (C) %s by %s", 'Mandriva', '2001-2008') ."\n" .N("Copyright (C) %s by %s", N("Mageia"), '2011') . "\n", + copyright => N("Copyright (C) %s by %s", 'Mandriva', '2001-2008') . "\n" . N("Copyright (C) %s by %s", N("Mageia"), '2011') . "\n", license => $license, wrap_license => 1, comments => N("Font installer."), website => 'http://www.mageia.org', diff --git a/perl-install/standalone/draksec b/perl-install/standalone/draksec index cf7d50a2a..b5fd5d5ca 100755 --- a/perl-install/standalone/draksec +++ b/perl-install/standalone/draksec @@ -41,14 +41,13 @@ use security::l10n; #/^-?-(\S+)$/ and $options{$1} = 1 foreach @ARGV; -my $in = 'interactive'->vnew('su'); +my $_in = 'interactive'->vnew('su'); # enforce being root $ugtk2::wm_icon = "/usr/share/mcc/themes/default/draksec-mdk.png"; -my ($w, %fields); +my ($w); ############################ I18N ################################### -my @help; my %translations = ( 'ALL' => N("ALL"), @@ -65,9 +64,6 @@ sub to_i18n { map { $translations{$_} || $_ } @_ } sub from_i18n { $inv_translations{$_[0]} || $_[0] } sub resize { gtkset($_[0], width => 50) } -%fields = security::l10n::fields(); -my %inv_fields = reverse %fields; - # factorize this with rpmdrake and harddrake2 sub wait_msg { my $mainw = ugtk2->new(N("Please wait"), (modal => 1, transient => $w->{real_window})); @@ -87,7 +83,7 @@ sub new_nonedit_combo { gtknew('ComboBox', text => to_i18n($o_default_value), list => [ to_i18n(@$string_list) ]); } -my $msec = new security::msec; +#my $msec = security::msec->new; $w = ugtk2->new(N("Security Level and Checks")); my $window = $w->{window}; @@ -179,7 +175,7 @@ my %descr = ( gtkpack_($vbox, 0, gtkshow(gtknew('VBox', spacing => 5, children => [ if_(!$::isEmbedded, 0, Gtk2::Banner->new('/usr/share/mcc/themes/default/drakperm-mdk.png', N("Permissions"))), - 0, gtknew('Label', text => $auth_string, alignment => [ 0.5, 0]) + 0, gtknew('Label', text => $auth_string, alignment => [ 0.5, 0 ]) ])), 1, gtkshow(create_scrolled_window( gtknew('VBox', children => [ diff --git a/perl-install/standalone/draksound b/perl-install/standalone/draksound index 01c1df5af..6a8e899ea 100755 --- a/perl-install/standalone/draksound +++ b/perl-install/standalone/draksound @@ -48,7 +48,7 @@ if (my @devices = detect_devices::probe_category('multimedia/sound')) { $in->ask_warn(N("No Sound Card detected!"), formatAlaTeX( #-PO: keep the double empty lines between sections, this is formatted a la LaTeX - N("No Sound Card has been detected on your machine. Please verify that a Linux-supported Sound Card is correctly plugged in"). + N("No Sound Card has been detected on your machine. Please verify that a Linux-supported Sound Card is correctly plugged in") . N("\n\n\nNote: if you've an ISA PnP sound card, you'll have to use the alsaconf or the sndconfig program. Just type \"alsaconf\" or \"sndconfig\" in a console."))); diff --git a/perl-install/standalone/drakups b/perl-install/standalone/drakups index a52384e67..8557aceff 100755 --- a/perl-install/standalone/drakups +++ b/perl-install/standalone/drakups @@ -236,8 +236,8 @@ sub edit_callback { sub del_callback { my ($model, $list) = @_; - my (undef, $iter) = $list->get_selection->get_selected; - my $removed_idx = $model->get($iter, 0); # 1st column is index + #my (undef, $iter) = $list->get_selection->get_selected; + #my $removed_idx = $model->get($iter, 0); # 1st column is index #@rules = grep { $_->{index} ne $removed_idx } @rules; #$tree->remove($iter); #sensitive_buttons(0); @@ -341,7 +341,7 @@ my $_msg = N("Welcome to the UPS configuration tools"); $w->{window}->add(gtkpack_(Gtk2::VBox->new, if_(!$::isEmbedded, 0, Gtk2::Banner->new('drakups', N("DrakUPS"))), 1, my $nb = Gtk2::Notebook->new, - 0, create_okcancel(my $oc = + 0, create_okcancel( { ok_clicked => sub { #$_->{save}->() foreach @pages; @@ -357,12 +357,6 @@ $w->{window}->add(gtkpack_(Gtk2::VBox->new, #------------------------------------------------------------------ # build the notebook -my %labels = ( - add => N("Add"), - edit => N("Edit"), - remove => N("Remove"), - ); - foreach my $i (@pages) { my $model = $models{$i->{id}} = Gtk2::ListStore->new("Glib::Int", ("Glib::String") x listlength(@{$i->{columns}})); my (%buttons, $list); diff --git a/perl-install/standalone/fileshareset b/perl-install/standalone/fileshareset index 77e0139c9..b5dcbfb16 100755 --- a/perl-install/standalone/fileshareset +++ b/perl-install/standalone/fileshareset @@ -153,7 +153,7 @@ sub read_conf { $conf{$cmd} = $value || warn qq(suspicious line "$_" in $authorisation_file\n); } # no close $F_lock, keep it locked - \%conf + \%conf; } sub check { @@ -170,7 +170,7 @@ sub check { # ok, access granted for everybody } else { my @l; - while (@l = getgrent) { + while (@l = getgrent()) { last if $l[0] eq $authorisation_group; } ::member($username, split(' ', $l[3])) or ::error($non_authorised); diff --git a/perl-install/standalone/interactive_http/interactive_http.cgi b/perl-install/standalone/interactive_http/interactive_http.cgi index 4da796719..24899c451 100755 --- a/perl-install/standalone/interactive_http/interactive_http.cgi +++ b/perl-install/standalone/interactive_http/interactive_http.cgi @@ -8,7 +8,7 @@ use c; my $q = CGI->new; $| = 1; -my $script_name = $q->url(-relative => 1); +my $script_name = $q->url('-relative' => 1); # name inversed (must be in sync with interactive_http.html) my $pipe_r = "/tmp/interactive_http_w"; @@ -27,24 +27,23 @@ if ($q->param('state') eq 'new') { error("booh..."); } -sub read_ { - local *F; - open F, "<$pipe_r" or error("Failed to connect to the prog"); +sub read_() { + open my $F, "<$pipe_r" or error("Failed to connect to the prog"); my $t; - print $t while sysread F, $t, 1; + print $t while sysread $F, $t, 1; } -sub write_ { +sub write_() { local *F; open F, ">$pipe_w" or die; my $q = CGI->new; $q->save(\*F); } -sub first_step { read_() } -sub next_step { write_(); read_() } +sub first_step() { read_() } +sub next_step() { write_(); read_() } -sub force_exit_dead_prog { +sub force_exit_dead_prog() { -p $pipe_w or return; { local *F; @@ -65,7 +64,7 @@ sub spawn_server { my @authorised_progs = map { chomp_($_) } cat_('/etc/drakxtools_http/authorised_progs'); member($prog, @authorised_progs) or error("You tried to call a non-authorised program"); - fork and return; + fork() and return; $ENV{INTERACTIVE_HTTP} = $script_name; @@ -78,9 +77,9 @@ sub spawn_server { } sub error { - print $q->header(), $q->start_html(); + print $q->header, $q->start_html; print $q->h1(N("Error")), @_; - print $q->end_html(), "\n"; + print $q->end_html, "\n"; exit 0; } diff --git a/perl-install/standalone/notify-x11-free-driver-switch b/perl-install/standalone/notify-x11-free-driver-switch index e871d2ee9..30c42f82c 100755 --- a/perl-install/standalone/notify-x11-free-driver-switch +++ b/perl-install/standalone/notify-x11-free-driver-switch @@ -8,7 +8,7 @@ $::isStandalone = 0; my $in = 'interactive'->vnew; my $driver = eval { require Xconfig::xfree; - $raw_X = Xconfig::xfree->read; + my $raw_X = Xconfig::xfree->read; $raw_X->get_Driver; } || N("unknown"); diff --git a/perl-install/standalone/scannerdrake b/perl-install/standalone/scannerdrake index 3a4bfea49..da7376813 100755 --- a/perl-install/standalone/scannerdrake +++ b/perl-install/standalone/scannerdrake @@ -29,10 +29,8 @@ use scanner; use handle_configs; use services; -my $companyname = "%s"; my $distroname = "%s"; my $shortdistroname = "%s"; -my $domainname = "mageia.org"; foreach (@ARGV) { /^--update-usbtable$/ and do { scanner::updateScannerDBfromUsbtable(); exit() }; @@ -94,7 +92,7 @@ sub auto() { my $changed = 0; foreach (@f) { my $c = 0; - if (member($_->{val}{DESCRIPTION}, keys %$scanner::scannerDB)) { + if (exists $scanner::scannerDB->{$_->{val}{DESCRIPTION}}) { my $name = $_->{val}{DESCRIPTION}; $name =~ s/\s$//; # some HP entries have a trailing space, i will correct usbtable asap if ($scanner::scannerDB->{$name}{flags}{unsupported}) { @@ -102,11 +100,11 @@ sub auto() { next; } if ($in->ask_yesorno(N("Confirmation"), N("%s found on %s, configure it automatically?", removeverticalbar($name), $_->{port}),1)) { - $c = (tryConfScanner($name, $_->{port}, + $c = tryConfScanner($name, $_->{port}, $_->{val}{vendor}, $_->{val}{id}) || manual($_->{port}, $_->{val}{vendor}, - $_->{val}{id}, $name)); + $_->{val}{id}, $name); } else { $c = manual($_->{port}, $_->{val}{vendor}, $_->{val}{id}, $name); @@ -149,10 +147,10 @@ sub dynamic() { @f = scanner::detect(); my $name; foreach (@f) { - if (member($_->{val}{DESCRIPTION}, keys %$scanner::scannerDB)) { + if (exists $scanner::scannerDB->{$_->{val}{DESCRIPTION}}) { $name = $_->{val}{DESCRIPTION}; $name =~ s/\s$//; #some HP entry have a trailing space, i will correct usbtable asap - next if ($scanner::scannerDB->{$name}{flags}{unsupported}); + next if $scanner::scannerDB->{$name}{flags}{unsupported}; if (my @modules = @{$scanner::scannerDB->{$name}{kernel}}) { modules::load(@modules); modules::append_to_modules_loaded_at_startup_for_all_kernels(@modules); @@ -195,8 +193,8 @@ sub installfirmware { return ""; } # Let user select a firmware file from a floppy, hard disk, ... - $firmware = $in->ask_file(N("Select firmware file"), "$dir"); - last if !$firmware || (-r $firmware); + $firmware = $in->ask_file(N("Select firmware file"), $dir); + last if !$firmware || -r $firmware; $in->ask_warn(N("Error"), N("The firmware file %s does not exist or is unreadable!", $firmware)); @@ -212,9 +210,9 @@ sub updatefirmware { my $firmware; my @scanners = map { - $_->{val}{DESCRIPTION} + $_->{val}{DESCRIPTION}; } grep { - $_->{val}{FIRMWARELINE} + $_->{val}{FIRMWARELINE}; } @configured; my ($scannerchoice, $mediachoice); while (1) { @@ -254,8 +252,8 @@ sub updatefirmware { } # Let user select a firmware file from a floppy, hard disk, ... $firmware = $in->ask_file(N("Select firmware file for the %s", - $scannerchoice), "$dir"); - last if !$firmware || (-r $firmware); + $scannerchoice), $dir); + last if !$firmware || -r $firmware; $in->ask_warn(N("Error"), N("The firmware file %s does not exist or is unreadable!", $firmware)); @@ -276,7 +274,7 @@ sub updatefirmware { return 0; } # Enter the path to the firmware in the appropriate config file - my $firmwareline =$_->{val}{FIRMWARELINE}; + my $firmwareline = $_->{val}{FIRMWARELINE}; $firmwareline =~ s/\$FIRMWARE/$firmware/sg; scanner::setfirmware($backend, $firmwareline); last; @@ -302,18 +300,18 @@ sub tryConfScanner { $in->ask_warn(N("Warning"), N("The %s must be configured by system-config-printer.\nYou can launch system-config-printer from the %s Control Center in Hardware section.", removeverticalbar($model), $shortdistroname)); return 0; } - my @modules = (); + my @modules; if (defined($scanner::scannerDB->{$model}{kernel})) { - push(@modules, @{$scanner::scannerDB->{$model}{kernel}}); - } elsif ((defined($scanner::scannerDB->{$model}{scsikernel})) && - ($scanner::scannerDB->{$model}{driver} =~ /SCSI/i)) { - push(@modules, @{$scanner::scannerDB->{$model}{scsikernel}}); - } elsif ((defined($scanner::scannerDB->{$model}{usbkernel})) && - ($scanner::scannerDB->{$model}{driver} =~ /USB/i)) { - push(@modules, @{$scanner::scannerDB->{$model}{usbkernel}}); - } elsif ((defined($scanner::scannerDB->{$model}{parportkernel})) && - ($scanner::scannerDB->{$model}{driver} =~ /Parport/i)) { - push(@modules, @{$scanner::scannerDB->{$model}{parportkernel}}); + push @modules, @{$scanner::scannerDB->{$model}{kernel}}; + } elsif (defined($scanner::scannerDB->{$model}{scsikernel}) && + $scanner::scannerDB->{$model}{driver} =~ /SCSI/i) { + push @modules, @{$scanner::scannerDB->{$model}{scsikernel}}; + } elsif (defined($scanner::scannerDB->{$model}{usbkernel}) && + $scanner::scannerDB->{$model}{driver} =~ /USB/i) { + push @modules, @{$scanner::scannerDB->{$model}{usbkernel}}; + } elsif (defined($scanner::scannerDB->{$model}{parportkernel}) && + $scanner::scannerDB->{$model}{driver} =~ /Parport/i) { + push @modules, @{$scanner::scannerDB->{$model}{parportkernel}}; } if ($#modules >= 0) { my $wait = $in->wait_message(N("Please wait"), @@ -321,8 +319,7 @@ sub tryConfScanner { foreach my $m (@modules) { eval { modules::load($m) }; if (!$@) { - modules::append_to_modules_loaded_at_startup_for_all_kernels - ($m); + modules::append_to_modules_loaded_at_startup_for_all_kernels($m); } } } @@ -395,7 +392,7 @@ sub tryConfScanner { ($vendor, $product) = scanner::get_usb_ids_for_port($port); my $firmware; my $server = $scanner::scannerDB->{$model}{server}; - if (grep { /FIRMWARELINE/ } @{$scanner::scannerDB->{$model}{lines}} ) { + if (any { /FIRMWARELINE/ } @{$scanner::scannerDB->{$model}{lines}}) { $firmware = installfirmware($model, $server); return 0 if $firmware eq "///"; } @@ -475,13 +472,13 @@ sub mainwindow { $buttonclicked = "manualadd"; 1; } }, - ( (grep { $_->{val}{FIRMWARELINE} } @configured) ? + ((any { $_->{val}{FIRMWARELINE} } @configured) ? { val => N("Install/Update firmware files"), type => 'button', clicked_may_quit => sub { $buttonclicked = "firmware"; 1; - } } : () ), + } } : ()), { val => N("Scanner sharing"), type => 'button', clicked_may_quit => sub { @@ -576,7 +573,7 @@ sub sharewindow { my $sanedrunning = services::starts_on_boot("saned"); my $oldsanedrunning = $sanedrunning; # Is the "net" SANE backend active - my $netbackendactive = grep { /^\s*net\s*$/ } + my $netbackendactive = find { /^\s*net\s*$/ } cat_("/etc/sane.d/dll.conf"); my $oldnetbackendactive = $netbackendactive; # Set this to 1 to tell the caller that the list of locally available @@ -668,7 +665,7 @@ sub sharewindow { 1; }, disabled => sub { - return ($#list < 0); + return $#list < 0; } }, { val => N("Remove selected host"), type => 'button', @@ -677,7 +674,7 @@ sub sharewindow { 1; }, disabled => sub { - return ($#list < 0); + return $#list < 0; } }, { val => N("Done"), type => 'button', @@ -818,7 +815,7 @@ sub sharewindow { 1; }, disabled => sub { - return ($#list < 0); + return $#list < 0; } }, { val => N("Remove selected host"), type => 'button', @@ -827,7 +824,7 @@ sub sharewindow { 1; }, disabled => sub { - return ($#list < 0); + return $#list < 0; } }, { val => N("Done"), type => 'button', diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 2e5c0abbb..e575f6098 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -114,7 +114,7 @@ sub find_xorg_driver { || -e "/usr/$lib/xorg/extra-modules/${new_driver}_drv.so"; } -sub after_x_driver_switch { +sub after_x_driver_switch() { # If a wrong driver is loaded, ask for a reboot. my $reboot_needed = -x "/sbin/display_driver_helper" && system("/sbin/display_driver_helper", "--check-loaded") != 0; if (!$reboot_needed) { |