diff options
-rw-r--r-- | Rpmdrake/gui.pm | 4 | ||||
-rw-r--r-- | Rpmdrake/open_db.pm | 3 | ||||
-rw-r--r-- | Rpmdrake/widgets.pm | 3 | ||||
-rwxr-xr-x | rpmdrake | 3 | ||||
-rw-r--r-- | rpmdrake.pm | 4 |
5 files changed, 10 insertions, 7 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index be9951a9..fb5193e6 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -726,7 +726,7 @@ sub ctreefy { sub build_tree { my ($tree, $tree_model, $elems, $options, $force_rebuild, $compssUsers, $flat, $mode) = @_; - my $old_mode if 0; + state $old_mode; $mode = $options->{rmodes}{$mode} || $mode; return if $old_mode eq $mode && !$force_rebuild; $old_mode = $mode; @@ -749,7 +749,7 @@ sub build_tree { } @keys; if (@keys == 0) { add_node('', N("(none)"), { nochild => 1 }); - my $explanation_only_once if 0; + state $explanation_only_once; $explanation_only_once or interactive_msg(N("No update"), N("The list of updates is empty. This means that either there is no available update for the packages installed on your computer, diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm index 864bfb4d..e8ff717b 100644 --- a/Rpmdrake/open_db.pm +++ b/Rpmdrake/open_db.pm @@ -28,6 +28,7 @@ use common; use rpmdrake; use URPM; use urpm; +use feature 'state'; use Exporter; our @ISA = qw(Exporter); @@ -40,7 +41,7 @@ sub open_rpm_db { my $host; log::explanations("opening the RPM database"); if ($::rpmdrake_options{parallel} && ((undef, $host) = @{$::rpmdrake_options{parallel}})) { - my $done if 0; + state $done; my $dblocation = "/var/cache/urpmi/distantdb/$host"; if (!$done || $o_force) { print "syncing db from $host to $dblocation..."; diff --git a/Rpmdrake/widgets.pm b/Rpmdrake/widgets.pm index a3f5e56a..a1f689a3 100644 --- a/Rpmdrake/widgets.pm +++ b/Rpmdrake/widgets.pm @@ -30,12 +30,13 @@ use lib qw(/usr/lib/libDrakX); use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk2 one use ugtk2 qw(:all); use Time::HiRes; +use feature 'state'; sub new { my ($_class) = @_; my $w = gtknew('TextView', editable => 0); - my $time if 0; + state $time; $w->signal_connect(size_allocate => sub { my ($w, $requisition) = @_; return if !ref($w->{anchors}); @@ -43,6 +43,7 @@ use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() whic use ugtk2 qw(:all); use Gtk2::Gdk::Keysyms; use Rpmdrake::widgets; +use feature 'state'; $ugtk2::wm_icon = "title-$MODE"; @@ -244,7 +245,7 @@ sub run_treeview_dialog { $tree->get_selection->signal_connect(changed => sub { my ($model, $iter) = $_[0]->get_selected; return if !$iter; - my $current_group if 0; + state $current_group; my $new_group = $model->get_path_str($iter); return if $current_group eq $new_group && !$force_displaying_group; $options->{clear_all_caches}->(); diff --git a/rpmdrake.pm b/rpmdrake.pm index 549428a3..04c3993c 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -40,7 +40,7 @@ use c; use POSIX qw(_exit); use common; use Locale::gettext; - +use feature 'state'; our @ISA = qw(Exporter); our $VERSION = '2.27'; @@ -638,7 +638,7 @@ by Mandriva Linux Official Updates.")), %options sub show_urpm_progress { my ($label, $pb, $mode, $file, $percent, $total, $eta, $speed) = @_; $file =~ s|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|$1xxxx$2|; #- if needed... - my $medium if 0; + state $medium; if ($mode eq 'copy') { $pb->set_fraction(0); $label->set_label(N("Copying file for medium `%s'...", $file)); |