// If a RPM needs to be redownloaded, return true, otherwise return false
If a RPM needs to be redownloaded, return true, otherwise return false
// If a RPM needs to be redownloaded return true otherwise return false
func updateCache(cachedRPMs []*rpm.PackageFile, rpmName, rpmURL, cacheDir string) bool {
	for _, cRPM := range cachedRPMs {
		if cRPM.Name() == rpmName {
			if !versionChanged(rpmURL, cacheDir, cRPM) {
				return false
			}
			staleRPM := fmt.Sprintf("%s/%s-%s-%s.%s.rpm",
				cacheDir,
				cRPM.Name(),
				cRPM.Version(),
				cRPM.Release(),
				cRPM.Architecture(),
			)
			if err := os.Remove(staleRPM); err != nil {
				return true
			}
		}
	}
	return true
}
func updateCache ( cachedRPMs [ ] * rpm . PackageFile , rpmName , rpmURL , cacheDir string ) bool { for _ , cRPM := range cachedRPMs { if cRPM . Name ( ) == rpmName { if ! versionChanged ( rpmURL , cacheDir , cRPM ) { return false } staleRPM := fmt . Sprintf ( " " , cacheDir , cRPM . Name ( ) , cRPM . Version ( ) , cRPM . Release ( ) , cRPM . Architecture ( ) , ) if err := os . Remove ( staleRPM ) ; err != nil { return true } } } return true }
If a RPM needs to be redownloaded, return true, otherwise return false
If a RPM needs to be redownloaded return true otherwise return false