summaryrefslogtreecommitdiff
path: root/doAptUpgrade.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-03 04:21:37 -0500
committerJeff Carr <[email protected]>2025-10-03 04:21:37 -0500
commitf4ce449e7ba5de977de8e8d100bf26dabafb97be (patch)
treeffa10311c38658280c80c5168a6dd4269a26c33e /doAptUpgrade.go
parent13dccc522038f8b4303972e3e78b7867193fdbeb (diff)
rename file
Diffstat (limited to 'doAptUpgrade.go')
-rw-r--r--doAptUpgrade.go79
1 files changed, 0 insertions, 79 deletions
diff --git a/doAptUpgrade.go b/doAptUpgrade.go
deleted file mode 100644
index ae0a248..0000000
--- a/doAptUpgrade.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
-// Use of this source code is governed by the GPL 3.0
-
-package main
-
-import (
- "fmt"
-
- "go.wit.com/lib/gui/shell"
- "go.wit.com/log"
-)
-
-func doAptUpgrade() {
- if argv.DryRun {
- log.Info("--dry-run", []string{"apt", "update"})
- } else {
- result := shell.Run([]string{"apt", "update"})
- if result.Error != nil {
- log.Info("apt update error:", result.Error)
- badExit(result.Error)
- }
- }
-
- fmt.Println("Installed Packages:")
- loop := me.machine.Wit.SortByName()
- for loop.Scan() {
- p := loop.Next()
- // log.Info("apt install", p.Name)
- if p.Name == "" {
- log.Info("something wrong. p.Name was blank", p)
- continue
- }
- if me.machine.IsInstalled(p.Name) {
- cmd := []string{"apt", "install", p.Name}
- if argv.DryRun {
- log.Info("--dry-run", cmd)
- } else {
- log.Info("Running:", cmd)
- shell.RunRealtime([]string{"apt", "install", p.Name})
- }
- }
- }
- okExit("installed")
-}
-
-func doAptList() {
- log.DaemonMode(true)
- defer log.DaemonMode(false)
- fmt.Println("Installed Packages:")
- loop := me.machine.Wit.SortByName()
- for loop.Scan() {
- p := loop.Next()
- var end string
- var version string
- if me.forge.Config.IsPrivate(p.Name) {
- end += "(private) "
- }
- if actualp := me.machine.FindByVersion(p.Name, p.Version); actualp != nil {
- // end += "(version match) "
- } else {
- end += "(version mismatch) " + actualp.Version + " " + version + " "
- }
- if actualp := me.machine.FindInstalledByName(p.Name); actualp != nil {
- if p.Version != actualp.Version {
- end += "(installed " + actualp.Version + " vs " + p.Version + ") "
- } else {
- end += "(installed ok) "
- }
- version = actualp.Version
- }
- if me.forge.Config.IsReadOnly(p.Name) {
- // end += " (readonly) "
- } else {
- end += "(writable) "
- }
- log.Printf("%-30s %-8s %s\n", p.Name, p.Version, end) // p.PkgName)
- }
- okExit("")
-}