// ImportRPM imports a single RPM named <rpm> from a given repo. It adds the
// RPM to the passed repo and returns the RPM struct.
ImportRPM imports a single RPM named  from a given repo. It adds the
RPM to the passed repo and returns the RPM struct.
// ImportRPM imports a single RPM named <rpm > from a given repo . It adds the // RPM to the passed repo and returns the RPM struct .
func ImportRPM(repo *Repo, rpm, path string, update bool) (*RPM, error) {
	var err error
	if err = loadRepoFromCache(repo, path); err != nil {
		return nil, err
	}
	var c redis.Conn
	if c, err = initRedis(0); err != nil {
		return nil, err
	}
	defer func() {
		_ = c.Close()
	}()
	for _, r := range repo.Packages {
		if r.Name == rpm {
			return r, storeRPMInfoRedis(c, repo, r)
		}
	}
	return nil, fmt.Errorf("unable to find %s RPM in %s repo", rpm, repo.Name)
}
func ImportRPM ( repo * Repo , rpm , path string , update bool ) ( * RPM , error ) { var err error if err = loadRepoFromCache ( repo , path ) ; err != nil { return nil , err } var c redis . Conn if c , err = initRedis ( 0 ) ; err != nil { return nil , err } defer func ( ) { _ = c . Close ( ) } ( ) for _ , r := range repo . Packages { if r . Name == rpm { return r , storeRPMInfoRedis ( c , repo , r ) } } return nil , fmt . Errorf ( " " , rpm , repo . Name ) }
ImportRPM imports a single RPM named  from a given repo.
ImportRPM imports a single RPM named from a given repo .