func downloadChart(pname string, untar bool, untardir string, verify bool, keyring string) error {
	r, err := repo.LoadRepositoriesFile(repositoriesFile())
	if err != nil {
		return err
	}

	// get download url
	u, err := mapRepoArg(pname, r.Repositories)
	if err != nil {
		return err
	}

	href := u.String()
	buf, err := fetchChart(href)
	if err != nil {
		return err
	}

	if verify {
		basename := filepath.Base(pname)
		sigref := href + ".prov"
		sig, err := fetchChart(sigref)
		if err != nil {
			return fmt.Errorf("provenance data not downloaded from %s: %s", sigref, err)
		}
		if err := ioutil.WriteFile(basename+".prov", sig.Bytes(), 0755); err != nil {
			return fmt.Errorf("provenance data not saved: %s", err)
		}
		if err := verifyChart(basename, keyring); err != nil {
			return err
		}
	}

	return saveChart(pname, buf, untar, untardir)
}
// downloadChart fetches a chart over HTTP, and then (if verify is true) verifies it.
//
// If untar is true, it also unpacks the file into untardir.
downloadChart fetches a chart over HTTP, and then (if verify is true) verifies it.

If untar is true, it also unpacks the file into untardir.
// downloadChart fetches a chart over HTTP and then ( if verify is true ) verifies it . // // If untar is true it also unpacks the file into untardir .
func downloadChart(pname string, untar bool, untardir string, verify bool, keyring string) error {
	r, err := repo.LoadRepositoriesFile(repositoriesFile())
	if err != nil {
		return err
	}
	u, err := mapRepoArg(pname, r.Repositories)
	if err != nil {
		return err
	}
	href := u.String()
	buf, err := fetchChart(href)
	if err != nil {
		return err
	}
	if verify {
		basename := filepath.Base(pname)
		sigref := href + ".prov"
		sig, err := fetchChart(sigref)
		if err != nil {
			return fmt.Errorf("provenance data not downloaded from %s: %s", sigref, err)
		}
		if err := ioutil.WriteFile(basename+".prov", sig.Bytes(), 0755); err != nil {
			return fmt.Errorf("provenance data not saved: %s", err)
		}
		if err := verifyChart(basename, keyring); err != nil {
			return err
		}
	}
	return saveChart(pname, buf, untar, untardir)
}
func downloadChart ( pname string , untar bool , untardir string , verify bool , keyring string ) error { r , err := repo . LoadRepositoriesFile ( repositoriesFile ( ) ) if err != nil { return err } u , err := mapRepoArg ( pname , r . Repositories ) if err != nil { return err } href := u . String ( ) buf , err := fetchChart ( href ) if err != nil { return err } if verify { basename := filepath . Base ( pname ) sigref := href + " " sig , err := fetchChart ( sigref ) if err != nil { return fmt . Errorf ( " " , sigref , err ) } if err := ioutil . WriteFile ( basename + " " , sig . Bytes ( ) , 0755 ) ; err != nil { return fmt . Errorf ( " " , err ) } if err := verifyChart ( basename , keyring ) ; err != nil { return err } } return saveChart ( pname , buf , untar , untardir ) }
downloadChart fetches a chart over HTTP, and then (if verify is true) verifies it.
downloadChart fetches a chart over HTTP and then ( if verify is true ) verifies it .
// get download url