From e9e0dd856c77ad3c2f54a53a3ca0eef23f69ede1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 09:01:45 -0500 Subject: new package --- old/apt.go | 39 +++++++++++++++++++++++++++++++++++++++ old/apt_darwin.go | 11 +++++++++++ old/apt_windows.go | 11 +++++++++++ 3 files changed, 61 insertions(+) create mode 100644 old/apt.go create mode 100644 old/apt_darwin.go create mode 100644 old/apt_windows.go (limited to 'old') diff --git a/old/apt.go b/old/apt.go new file mode 100644 index 0000000..4b9018b --- /dev/null +++ b/old/apt.go @@ -0,0 +1,39 @@ +package zoopb + +import ( + "fmt" +) + +// init the installed package list +func initPackages(me *Machine) { + // Get the list of installed packages for the detected distro + newP, err := getPackageList(me.Distro) + if err != nil { + fmt.Println("Error:", err) + return + } + + if me.Packages == nil { + me.Packages = new(Packages) + } + + // Print the installed packages and their versions + for pkg, version := range newP { + new1 := new(Package) + new1.Name = pkg + new1.Version = version + me.Packages.Append(new1) + // log.Info("added", new1.Name, "failed") + } + + me.getMemory() +} + +/* +func (me *Machine) addNew(name string, version string) { + new1 := new(Package) + new1.Name = name + new1.Version = version + me.Packages.Append(new1) +} +*/ diff --git a/old/apt_darwin.go b/old/apt_darwin.go new file mode 100644 index 0000000..0fc8e0f --- /dev/null +++ b/old/apt_darwin.go @@ -0,0 +1,11 @@ +package zoopb + +import ( + "go.wit.com/log" +) + +// getPackageList returns the list of installed packages based on the distro +func getPackageList(distro string) (map[string]string, error) { + log.Info("zoopb: have not done macos yet, skipping okay") + return nil, nil +} diff --git a/old/apt_windows.go b/old/apt_windows.go new file mode 100644 index 0000000..feec104 --- /dev/null +++ b/old/apt_windows.go @@ -0,0 +1,11 @@ +package zoopb + +import ( + "go.wit.com/log" +) + +// getPackageList returns the list of installed packages based on the distro +func getPackageList(distro string) (map[string]string, error) { + log.Info("zoopb: have not done windows yet, skipping okay") + return nil, nil +} -- cgit v1.2.3