summaryrefslogtreecommitdiff
path: root/doUpgrade.go
diff options
context:
space:
mode:
Diffstat (limited to 'doUpgrade.go')
-rw-r--r--doUpgrade.go31
1 files changed, 28 insertions, 3 deletions
diff --git a/doUpgrade.go b/doUpgrade.go
index ee8e7f3..7fb3f88 100644
--- a/doUpgrade.go
+++ b/doUpgrade.go
@@ -10,15 +10,40 @@ import (
"go.wit.com/log"
)
+func doPackageList(all bool) {
+ installed := zoopb.NewPackages()
+ for p := range me.machine.Wit.IterAll() {
+ found := me.machine.FindInstalledByName(p.Name)
+ if found == nil {
+ continue
+ }
+ p.Installed = true
+ installed.Append(p)
+ }
+ if all {
+ me.machine.Wit.PrintTable()
+ } else {
+ installed.PrintTable()
+ }
+}
+
func doUpgrade() error {
+ me.machine, _ = zoopb.InitMachine()
+
+ if argv.Upgrade.List != nil {
+ if argv.Upgrade.All {
+ doPackageList(true)
+ } else {
+ doPackageList(false)
+ }
+ return nil
+ }
+
if !argv.DryRun {
checkSuperuser()
-
aptUpdate()
}
- me.machine, _ = zoopb.InitMachine()
-
var installed []string
fmt.Println("Installed Packages:")