func (p *Packages) Exec() error {
	switch p.Conf.Pkg {
	case APT:
		out, err := exec.Command("/usr/lib/update-notifier/apt-check").CombinedOutput()
		if err != nil {
			return errors.Wrap(err, "executing command failed")
		}

		p.Data.Packages, err = parseAPT(out)
		return errors.Wrap(err, "parsing output failed")

	case APT_HOOK:
		out, err := ioutil.ReadFile("/var/opt/updates")
		if err != nil {
			return errors.Wrap(err, "reading updates file failed")
		}

		p.Data.Packages, err = parseAPT(out)
		return errors.Wrap(err, "parsing output failed")

	default:
		return errors.New("Invalid package manager")
	}
}
// Exec collects the information
// Check the PackageManager constant to learn about supported package managers.
Exec collects the information
Check the PackageManager constant to learn about supported package managers.
// Exec collects the information // Check the PackageManager constant to learn about supported package managers .
func (p *Packages) Exec() error {
	switch p.Conf.Pkg {
	case APT:
		out, err := exec.Command("/usr/lib/update-notifier/apt-check").CombinedOutput()
		if err != nil {
			return errors.Wrap(err, "executing command failed")
		}
		p.Data.Packages, err = parseAPT(out)
		return errors.Wrap(err, "parsing output failed")
	case APT_HOOK:
		out, err := ioutil.ReadFile("/var/opt/updates")
		if err != nil {
			return errors.Wrap(err, "reading updates file failed")
		}
		p.Data.Packages, err = parseAPT(out)
		return errors.Wrap(err, "parsing output failed")
	default:
		return errors.New("Invalid package manager")
	}
}
func ( p * Packages ) Exec ( ) error { switch p . Conf . Pkg { case APT : out , err := exec . Command ( " " ) . CombinedOutput ( ) if err != nil { return errors . Wrap ( err , " " ) } p . Data . Packages , err = parseAPT ( out ) return errors . Wrap ( err , " " ) case APT_HOOK : out , err := ioutil . ReadFile ( " " ) if err != nil { return errors . Wrap ( err , " " ) } p . Data . Packages , err = parseAPT ( out ) return errors . Wrap ( err , " " ) default : return errors . New ( " " ) } }
Exec collects the information
Check the PackageManager constant to learn about supported package managers.
Exec collects the information Check the PackageManager constant to learn about supported package managers .