// 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/log" ) func doAptList() { log.DaemonMode(true) defer log.DaemonMode(false) fmt.Println("Installed Packages:") loop := me.machine.Wit.SortByPackage() for loop.Scan() { p := loop.Next() var end string var version string if me.forge.Config.IsPrivate(p.Package) { end += "(private) " } if actualp := me.machine.FindByVersion(p.Package, p.Version); actualp != nil { // end += "(version match) " } else { end += "(version mismatch) " + actualp.Version + " " + version + " " } if actualp := me.machine.FindInstalledByName(p.Package); 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.Package) { // end += " (readonly) " } else { end += "(writable) " } log.Printf("%-30s %-8s %s\n", p.Package, p.Version, end) // p.PkgName) } me.sh.GoodExit("") }