From 31d8bbdc3d44ec41a8ad359d62ebfb2d0f35662d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 28 Mar 2012 18:42:15 +0000 Subject: perl_checker cleanups --- MageiaUpdate | 2 +- Rpmdrake/init.pm | 2 +- Rpmdrake/open_db.pm | 6 +++--- Rpmdrake/pkg.pm | 9 ++++++--- rpmdrake.pm | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/MageiaUpdate b/MageiaUpdate index 4cfe8fec..5358a7c4 100755 --- a/MageiaUpdate +++ b/MageiaUpdate @@ -263,7 +263,7 @@ sub run_treeview_dialog { my $cell = ($bool_col->get_cell_renderers)[0]; $cell->signal_connect(toggled => sub { my ($_cell, $text_path) = @_; - my $name = @{$list->{data}[$text_path]}[$pkg_columns{text}]; + my $name = $list->{data}[$text_path][$pkg_columns{text}]; gtkset_mousecursor_wait($w->{real_window}->window); my $_guard = before_leaving(sub { gtkset_mousecursor_normal($w->{real_window}->window) }); toggle($list, $name); diff --git a/Rpmdrake/init.pm b/Rpmdrake/init.pm index c9a4262b..5b636eab 100644 --- a/Rpmdrake/init.pm +++ b/Rpmdrake/init.pm @@ -121,7 +121,7 @@ foreach (@ARGV) { foreach my $option (qw(media mode parallel rpm-root search)) { if (defined $rpmdrake_options{$option} && !ref($rpmdrake_options{$option})) { - warn "wrong usage of \"$option\" option!\n"; + warn qq(wrong usage of "$option" option!\n); exit(-1); # too early for my_exit() } } diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm index 86b95be1..ee75badd 100644 --- a/Rpmdrake/open_db.pm +++ b/Rpmdrake/open_db.pm @@ -81,7 +81,7 @@ sub fast_open_urpmi_db() { urpm::set_files($urpm, $::rpmdrake_options{'urpmi-root'}[0]) if $::rpmdrake_options{'urpmi-root'}[0]; $::rpmdrake_options{'rpm-root'}[0] ||= $::rpmdrake_options{'urpmi-root'}[0]; urpm::args::set_root($urpm, $::rpmdrake_options{'rpm-root'}[0]) if $::rpmdrake_options{'rpm-root'}[0]; - urpm::args::set_debug($urpm) if $::rpmdrake_options{'debug'}; + urpm::args::set_debug($urpm) if $::rpmdrake_options{debug}; $urpm->get_global_options; my $error_happened; $urpm->{options}{wait_lock} = $::rpmdrake_options{'wait-lock'}; @@ -103,7 +103,7 @@ sub fast_open_urpmi_db() { N("A fatal error occurred: %s.", $_[1])); }; - urpm::media::read_config($urpm); + urpm::media::read_config($urpm, 0); foreach (@{$urpm->{media}}) { next if $_->{ignore}; urpm::media::_tempignore($_, 1) if $ignore_debug_media->[0] && $_->{name} =~ /debug/i; @@ -116,7 +116,7 @@ sub fast_open_urpmi_db() { $urpm; } -sub is_it_a_devel_distro { +sub is_it_a_devel_distro() { state $res; return $res if defined $res; diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index f44ed9fb..4182dfa1 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -663,8 +663,11 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( return perform_parallel_install($urpm, $group, $w, \$statusbar_msg_id); } - my $lock = urpm::lock::urpmi_db($urpm, undef, wait => $urpm->{options}{wait_lock}) if !$::env; - my $rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive') if !$::env; + my ($lock, $rpm_lock); + if (!$::env) { + $lock = urpm::lock::urpmi_db($urpm, undef, wait => $urpm->{options}{wait_lock}); + $rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive'); + } my $state = $priority_state || $probe_only_for_updates ? { } : $urpm->{rpmdrake_state}; my $bar_id = statusbar_msg(N("Checking validity of requested packages..."), 0); @@ -743,7 +746,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( } } - urpm::orphans::mark_as_requested($urpm, $state); + urpm::orphans::mark_as_requested($urpm, $state, 0); my ($progress, $total, @rpms_upgrade); my $transaction; diff --git a/rpmdrake.pm b/rpmdrake.pm index a6180a39..837e4c8f 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -224,7 +224,7 @@ sub writeconf() { # special case: $no_confirmation->[0] = $::rpmdrake_options{'no-confirmation'}; - output $configfile, map { "$_ " . (ref ${$config{$_}{var}} ? join(' ', @${$config{$_}{var}}) : ()) . "\n" } keys %config; + output($configfile, map { "$_ " . (ref ${$config{$_}{var}} ? join(' ', @${$config{$_}{var}}) : undef) . "\n" } keys %config); } sub getbanner() { @@ -914,7 +914,7 @@ sub add_medium_and_check { urpm::media::write_config($urpm); $options->{proxy} and urpm::download::dump_proxy_config(); } else { - urpm::media::read_config($urpm); + urpm::media::read_config($urpm, 0); return 0; } -- cgit v1.2.1