From 60d41817a4c086c1d3a800d8c1c56b9aba65f906 Mon Sep 17 00:00:00 2001 From: freesource Date: Tue, 16 Oct 2001 06:57:27 +0000 Subject: [PATCH] The logic is now correct for the new option --reinstall. --- SWIM/Safex.pm | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/SWIM/Safex.pm b/SWIM/Safex.pm index ddda510..1589d60 100644 --- a/SWIM/Safex.pm +++ b/SWIM/Safex.pm @@ -171,8 +171,10 @@ sub xyz { print "\n"; exit; } - if (($commands->{"r"} || $commands->{"remove"}) && $commands->{"purge"} && - $commands->{"reinstall"}) { + if ((($commands->{"r"} || $commands->{"remove"}) && $commands->{"purge"}) || + (($commands->{"r"} || $commands->{"remove"}) && $commands->{"reinstall"}) + || ($commands->{"reinstall"} && $commands->{"purge"}) +) { print "swim: "; print "-r " if defined $commands->{"r"}; print "--remove " if defined $commands->{"remove"}; @@ -271,11 +273,20 @@ sub xyz { history_print($arg,\%commands); } } - !($commands->{"r"} || $commands{"remove"}) ? - system "$apt_get install -qs $arg" : - system "$apt_get remove -qs $arg"; - system "$apt_get --purge remove -qs $arg" if $commands->{"purge"}; - system "$apt_get --reinstall install -qs $arg" if $commands->{"reinstall"}; + + if ( $commands->{"r"} || $commands{"remove"} ) { + system "$apt_get remove -qs $arg"; + } + elsif ( $commands->{"purge"} ) { + system "$apt_get --purge remove -qs $arg"; + } + elsif ( $commands->{"reinstall"} ) { + system "$apt_get --reinstall install -qs $arg"; + } + else { + system "$apt_get install -qs $arg"; + } + } #####################