From 91a2e19799bdb10a37b9b48d943f00cd87b71ba9 Mon Sep 17 00:00:00 2001 From: j pipkin Date: Fri, 20 Sep 2013 22:24:04 -0500 Subject: collapse two consecutive "unless ($force) {" sections into one, get rid of globally-unused %updates --- sboupgrade | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sboupgrade b/sboupgrade index 510a41d..a0e354c 100755 --- a/sboupgrade +++ b/sboupgrade @@ -140,15 +140,12 @@ if ($install_new) { my $upgrade_queue; -# doesn't matter what's updatable and what's not if force is specified -my %updates unless $force; -unless ($force) { - my $updates = get_available_updates; - $updates{$$_{name}} = 1 for @$updates; -} - +# doesn't matter what's updatable and what's not if force is specified, # but without force, we only want to update what there are updates for unless ($force) { + my %updates; + my $updates = get_available_updates; + $updates{$$_{name}} = 1 for @$updates; for my $sbo (@sbos) { push @$upgrade_queue, $sbo if $updates{$sbo}; } -- cgit v1.2.3