// FetchUpdate downloads manifests from the u.URL server
FetchUpdate downloads manifests from the u.URL server
// FetchUpdate downloads manifests from the u . URL server
func FetchUpdate(u UInfo) error {
	helpers.PrintBegin("fetching manifests from %s at version %v", u.URL, u.Ver)
	baseCache := filepath.Join(u.CacheLoc, "update")
	outMoM := filepath.Join(baseCache, u.Ver, "Manifest.MoM")
	err := helpers.DownloadManifest(u.URL, u.Ver, "MoM", outMoM)
	if err != nil {
		return err
	}
	mom, err := swupd.ParseManifestFile(outMoM)
	if err != nil {
		return err
	}
	for i := range mom.Files {
		ver := uint(mom.Files[i].Version)
		if ver < u.MinVer {
			continue
		}
		outMan := filepath.Join(baseCache, fmt.Sprint(ver), "Manifest."+mom.Files[i].Name)
		err := helpers.DownloadManifest(u.URL, fmt.Sprint(ver), mom.Files[i].Name, outMan)
		if err != nil {
			return err
		}
	}
	helpers.PrintComplete("manifests cached at %s", baseCache)
	return nil
}
func FetchUpdate ( u UInfo ) error { helpers . PrintBegin ( " " , u . URL , u . Ver ) baseCache := filepath . Join ( u . CacheLoc , " " ) outMoM := filepath . Join ( baseCache , u . Ver , " " ) err := helpers . DownloadManifest ( u . URL , u . Ver , " " , outMoM ) if err != nil { return err } mom , err := swupd . ParseManifestFile ( outMoM ) if err != nil { return err } for i := range mom . Files { ver := uint ( mom . Files [ i ] . Version ) if ver < u . MinVer { continue } outMan := filepath . Join ( baseCache , fmt . Sprint ( ver ) , " " + mom . Files [ i ] . Name ) err := helpers . DownloadManifest ( u . URL , fmt . Sprint ( ver ) , mom . Files [ i ] . Name , outMan ) if err != nil { return err } } helpers . PrintComplete ( " " , baseCache ) return nil }
FetchUpdate downloads manifests from the u.URL server
FetchUpdate downloads manifests from the u . URL server