summaryrefslogtreecommitdiff
path: root/apt.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-21 19:48:53 -0600
committerJeff Carr <[email protected]>2024-11-21 19:48:53 -0600
commit6f6f28a22a479c80be7bb99cfdea4244cb667194 (patch)
tree88716418433148a2fd60613621e314a8349ec8e3 /apt.go
parent1f0a18a0a8e21a831dbc002b8b4110298739b875 (diff)
minor fixupsv0.0.7
Diffstat (limited to 'apt.go')
-rw-r--r--apt.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/apt.go b/apt.go
index cf8a4fd..a6a68cb 100644
--- a/apt.go
+++ b/apt.go
@@ -15,6 +15,10 @@ func (me *Machine) initPackages() {
return
}
+ if me.Packages == nil {
+ me.Packages = new(Packages)
+ }
+
// Print the installed packages and their versions
for pkg, version := range newP {
new1 := new(Package)
@@ -37,7 +41,7 @@ func (me *Machine) addNew(name string, version string) bool {
return me.Packages.Append(new1)
}
-func (me *Machine) updatePackages() string {
+func (me *Machine) UpdatePackages() string {
// Get the list of installed packages for the detected distro
newP, err := getPackageList(me.Distro)
if err != nil {