summaryrefslogtreecommitdiff
path: root/doUpgrade.go
diff options
context:
space:
mode:
Diffstat (limited to 'doUpgrade.go')
-rw-r--r--doUpgrade.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/doUpgrade.go b/doUpgrade.go
index 61006b9..ee8e7f3 100644
--- a/doUpgrade.go
+++ b/doUpgrade.go
@@ -19,6 +19,8 @@ func doUpgrade() error {
me.machine, _ = zoopb.InitMachine()
+ var installed []string
+
fmt.Println("Installed Packages:")
loop := me.machine.Wit.SortByName()
for loop.Scan() {
@@ -47,13 +49,17 @@ func doUpgrade() error {
continue
}
- if argv.Force {
- aptRemove(p.Name)
- aptInstall(p.Name)
- } else {
- aptInstall(p.Name)
+ installed = append(installed, p.Name)
+ }
+ if argv.Force {
+ // force remove the packages. can be used if binaries change but versions didn't
+ for _, pkgname := range installed {
+ aptRemove(pkgname)
}
}
+ for _, pkgname := range installed {
+ aptInstall(pkgname)
+ }
okExit("installed")
return nil
}