summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.go11
-rw-r--r--update.go16
2 files changed, 3 insertions, 24 deletions
diff --git a/init.go b/init.go
index c030a9f..92965b1 100644
--- a/init.go
+++ b/init.go
@@ -8,17 +8,6 @@ import (
"go.wit.com/log"
)
-// sent via -ldflags
-var VERSION string
-var BUILDTIME string
-
-/*
-func (m *zoopb.Machine) SinceLastUpdate() time.Duration {
- age := m.Laststamp.AsTime()
- return time.Since(age)
-}
-*/
-
func InitMachine() *zoopb.Machine {
var fullname string
var err error
diff --git a/update.go b/update.go
index 0033447..5c8de16 100644
--- a/update.go
+++ b/update.go
@@ -79,15 +79,14 @@ func (me *Machine) UpdatePackages() string {
}
*/
-func UpdatePackages(me *zoopb.Machine) string {
+func UpdatePackages(me *zoopb.Machine) error {
// Get the list of installed packages for the detected distro
newP, err := getPackageList(me.Distro)
if err != nil {
fmt.Println("Error:", err)
- return fmt.Sprintln("getPackageList()", err)
+ return err
}
- var newCounter, changeCounter int
// Print the installed packages and their versions
for pname, version := range newP {
found := me.Packages.FindByName(pname)
@@ -97,7 +96,6 @@ func UpdatePackages(me *zoopb.Machine) string {
new1.Name = pname
new1.Version = version
me.Packages.Append(new1)
- newCounter += 1
} else {
found.Version = version
// panic("redo this. broken after autogenpb. was never right anyway")
@@ -106,13 +104,5 @@ func UpdatePackages(me *zoopb.Machine) string {
//}
}
}
-
- footer := fmt.Sprintf("%s has distro %s with %d packages installed", me.Hostname, me.Distro, me.Packages.Len())
- if changeCounter != 0 {
- footer += fmt.Sprintf(" (%d changed)", changeCounter)
- }
- if newCounter != 0 {
- footer += fmt.Sprintf(" (%d new)", newCounter)
- }
- return footer
+ return nil
}