// GetUpstreamInfo populates the UInfo struct and returns it
GetUpstreamInfo populates the UInfo struct and returns it
// GetUpstreamInfo populates the UInfo struct and returns it
func GetUpstreamInfo(conf *config.Config, upstreamURL string, version string, recursive bool, update bool) (UInfo, error) {
	u := UInfo{}
	if upstreamURL == "" {
		u.URL = conf.UpstreamURL
	} else {
		u.URL = upstreamURL
	}
	u.Update = update
	u.CacheLoc = conf.Paths.CacheLocation
	var err error
	u.Ver = version
	if u.Ver == "" {
		u.Ver, err = helpers.GetLatestVersion(u.URL)
		if err != nil {
			return u, err
		}
	}
	if !recursive {
		var mv int
		mv, err = strconv.Atoi(u.Ver)
		if err != nil {
			return u, err
		}
		u.MinVer = uint(mv)
	}
	return u, err
}
func GetUpstreamInfo ( conf * config . Config , upstreamURL string , version string , recursive bool , update bool ) ( UInfo , error ) { u := UInfo { } if upstreamURL == " " { u . URL = conf . UpstreamURL } else { u . URL = upstreamURL } u . Update = update u . CacheLoc = conf . Paths . CacheLocation var err error u . Ver = version if u . Ver == " " { u . Ver , err = helpers . GetLatestVersion ( u . URL ) if err != nil { return u , err } } if ! recursive { var mv int mv , err = strconv . Atoi ( u . Ver ) if err != nil { return u , err } u . MinVer = uint ( mv ) } return u , err }
GetUpstreamInfo populates the UInfo struct and returns it
GetUpstreamInfo populates the UInfo struct and returns it
// no support yet for modifying cache location via commandline // get latest upstream version