Example #1
0
func NewPackage(sysPackage system.Package) *Package {
	name := sysPackage.Name()
	versions, _ := sysPackage.Versions()
	installed, _ := sysPackage.Installed()
	return &Package{
		Name:      name,
		Versions:  versions,
		Installed: installed.(bool),
	}
}
Example #2
0
func NewPackage(sysPackage system.Package, config util.Config) (*Package, error) {
	name := sysPackage.Name()
	installed, _ := sysPackage.Installed()
	p := &Package{
		Name:      name,
		Installed: installed.(bool),
	}
	if !contains(config.IgnoreList, "versions") {
		versions, _ := sysPackage.Versions()
		p.Versions = versions
	}
	return p, nil
}
Example #3
0
func NewPackage(sysPackage system.Package, ignoreList []string) *Package {
	name := sysPackage.Name()
	installed, _ := sysPackage.Installed()
	p := &Package{
		Name:      name,
		Installed: installed.(bool),
	}
	if !contains(ignoreList, "versions") {
		versions, _ := sysPackage.Versions()
		p.Versions = versions
	}
	return p
}