aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorj pipkin <j@dawnrazor.net>2013-09-20 22:24:04 -0500
committerj pipkin <j@dawnrazor.net>2013-09-20 22:24:04 -0500
commit91a2e19799bdb10a37b9b48d943f00cd87b71ba9 (patch)
tree5d190292704834b50ab9daa2b89b893b4c36fb58
parent7cbfb8f6aa04b0c6a6c6967c28fc514e164f251b (diff)
downloadsbotools2-91a2e19799bdb10a37b9b48d943f00cd87b71ba9.tar.xz
collapse two consecutive "unless ($force) {" sections into one, get rid of globally-unused %updates
-rwxr-xr-xsboupgrade11
1 files 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};
}