// DownloadRepoFiles downloads all RPM packages from the RPM repo at the given
// baseURL by first parsing the repo metadata. These packages are downloaded to
// the c.CacheLocation/rpms/<version>/packages/ if they do not already exist
// there.
DownloadRepoFiles downloads all RPM packages from the RPM repo at the given
baseURL by first parsing the repo metadata. These packages are downloaded to
the c.CacheLocation/rpms//packages/ if they do not already exist
there.
// DownloadRepoFiles downloads all RPM packages from the RPM repo at the given // baseURL by first parsing the repo metadata . These packages are downloaded to // the c . CacheLocation / rpms / <version > / packages / if they do not already exist // there .
func DownloadRepoFiles(repo *Repo, update bool) (string, error) {
	var err error
	c, err = config.ReadConfig("")
	if err != nil {
		return "", err
	}
	workingDir := filepath.Join(
		c.Paths.CacheLocation,
		"rpms",
		repo.Name,
		repo.Version,
		repo.Type,
	)
	if err = os.MkdirAll(workingDir, 0755); err != nil {
		return "", err
	}
	url, err := buildFilelistsURL(repo, workingDir, update)
	if err != nil {
		return "", err
	}
	flistsPath := filepath.Join(workingDir, "filelists.xml")
	err = helpers.DownloadFile(url, flistsPath, update)
	if err != nil {
		return "", err
	}
	packages, err := buildPackageURLs(repo, flistsPath, workingDir, update)
	if err != nil {
		return "", err
	}
	return filepath.Join(workingDir, "packages"), downloadAllRPMs(packages, workingDir)
}
func DownloadRepoFiles ( repo * Repo , update bool ) ( string , error ) { var err error c , err = config . ReadConfig ( " " ) if err != nil { return " " , err } workingDir := filepath . Join ( c . Paths . CacheLocation , " " , repo . Name , repo . Version , repo . Type , ) if err = os . MkdirAll ( workingDir , 0755 ) ; err != nil { return " " , err } url , err := buildFilelistsURL ( repo , workingDir , update ) if err != nil { return " " , err } flistsPath := filepath . Join ( workingDir , " " ) err = helpers . DownloadFile ( url , flistsPath , update ) if err != nil { return " " , err } packages , err := buildPackageURLs ( repo , flistsPath , workingDir , update ) if err != nil { return " " , err } return filepath . Join ( workingDir , " " ) , downloadAllRPMs ( packages , workingDir ) }
DownloadRepoFiles downloads all RPM packages from the RPM repo at the given
baseURL by first parsing the repo metadata.
DownloadRepoFiles downloads all RPM packages from the RPM repo at the given baseURL by first parsing the repo metadata .
// this file can be either gz or xz compressed, use DownloadFile // which will use whatever extraction method is appropriate based // on the file extension.