// CheckManifestHashes compares manifest hashes against the hashes listed in
// the MoM for that version
CheckManifestHashes compares manifest hashes against the hashes listed in
the MoM for that version
// CheckManifestHashes compares manifest hashes against the hashes listed in // the MoM for that version
func CheckManifestHashes(r *diva.Results, c *config.Config, version, minVer uint) error {
	cLoc := filepath.Join(c.Paths.CacheLocation, "update")
	momPath := filepath.Join(cLoc, fmt.Sprint(version), "Manifest.MoM")
	MoM, err := swupd.ParseManifestFile(momPath)
	if err != nil {
		return err
	}
	for i := range MoM.Files {
		if uint(MoM.Files[i].Version) < minVer {
			continue
		}
		mPath := filepath.Join(
			cLoc, fmt.Sprint(MoM.Files[i].Version), "Manifest."+MoM.Files[i].Name)
		hash, err := swupd.Hashcalc(mPath)
		if err != nil {
			return err
		}
		desc := fmt.Sprintf("Manifest.%s hash matches hash in MoM", MoM.Files[i].Name)
		r.Ok(hash == MoM.Files[i].Hash, desc)
	}
	return nil
}
func CheckManifestHashes ( r * diva . Results , c * config . Config , version , minVer uint ) error { cLoc := filepath . Join ( c . Paths . CacheLocation , " " ) momPath := filepath . Join ( cLoc , fmt . Sprint ( version ) , " " ) MoM , err := swupd . ParseManifestFile ( momPath ) if err != nil { return err } for i := range MoM . Files { if uint ( MoM . Files [ i ] . Version ) < minVer { continue } mPath := filepath . Join ( cLoc , fmt . Sprint ( MoM . Files [ i ] . Version ) , " " + MoM . Files [ i ] . Name ) hash , err := swupd . Hashcalc ( mPath ) if err != nil { return err } desc := fmt . Sprintf ( " " , MoM . Files [ i ] . Name ) r . Ok ( hash == MoM . Files [ i ] . Hash , desc ) } return nil }
CheckManifestHashes compares manifest hashes against the hashes listed in
the MoM for that version
CheckManifestHashes compares manifest hashes against the hashes listed in the MoM for that version