func NewCharmAtPathForceSeries(path, series string, force bool) (charm.Charm, *charm.URL, error) {
	if path == "" {
		return nil, nil, errors.New("empty charm path")
	}
	_, err := os.Stat(path)
	if isNotExistsError(err) {
		return nil, nil, os.ErrNotExist
	} else if err == nil && !isValidCharmOrBundlePath(path) {
		return nil, nil, InvalidPath(path)
	}
	ch, err := charm.ReadCharm(path)
	if err != nil {
		if isNotExistsError(err) {
			return nil, nil, CharmNotFound(path)
		}
		return nil, nil, err
	}
	absPath, err := filepath.Abs(path)
	if err != nil {
		return nil, nil, err
	}
	_, name := filepath.Split(absPath)

	seriesToUse, err := charmSeries(series, force, ch)
	if err != nil {
		return nil, nil, err
	}

	url := &charm.URL{
		Schema:   "local",
		Name:     name,
		Series:   seriesToUse,
		Revision: ch.Revision(),
	}
	return ch, url, nil
}
// NewCharmAtPathForSeries returns the charm represented by this path,
// and a URL that describes it. If the series is empty,
// the charm's default series is used, if any.
// Otherwise, the series is validated against those the
// charm declares it supports. If force is true, then any
// series validation errors are ignored and the requested
// series is used regardless. Note though that is it still
// an error if the series is not specified and the charm does not
// define any.
NewCharmAtPathForSeries returns the charm represented by this path,
and a URL that describes it. If the series is empty,
the charm's default series is used, if any.
Otherwise, the series is validated against those the
charm declares it supports. If force is true, then any
series validation errors are ignored and the requested
series is used regardless. Note though that is it still
an error if the series is not specified and the charm does not
define any.
// NewCharmAtPathForSeries returns the charm represented by this path // and a URL that describes it . If the series is empty // the charm ' s default series is used if any . // Otherwise the series is validated against those the // charm declares it supports . If force is true then any // series validation errors are ignored and the requested // series is used regardless . Note though that is it still // an error if the series is not specified and the charm does not // define any .
func NewCharmAtPathForceSeries(path, series string, force bool) (charm.Charm, *charm.URL, error) {
	if path == "" {
		return nil, nil, errors.New("empty charm path")
	}
	_, err := os.Stat(path)
	if isNotExistsError(err) {
		return nil, nil, os.ErrNotExist
	} else if err == nil && !isValidCharmOrBundlePath(path) {
		return nil, nil, InvalidPath(path)
	}
	ch, err := charm.ReadCharm(path)
	if err != nil {
		if isNotExistsError(err) {
			return nil, nil, CharmNotFound(path)
		}
		return nil, nil, err
	}
	absPath, err := filepath.Abs(path)
	if err != nil {
		return nil, nil, err
	}
	_, name := filepath.Split(absPath)
	seriesToUse, err := charmSeries(series, force, ch)
	if err != nil {
		return nil, nil, err
	}
	url := &charm.URL{
		Schema:   "local",
		Name:     name,
		Series:   seriesToUse,
		Revision: ch.Revision(),
	}
	return ch, url, nil
}
func NewCharmAtPathForceSeries ( path , series string , force bool ) ( charm . Charm , * charm . URL , error ) { if path == " " { return nil , nil , errors . New ( " " ) } _ , err := os . Stat ( path ) if isNotExistsError ( err ) { return nil , nil , os . ErrNotExist } else if err == nil && ! isValidCharmOrBundlePath ( path ) { return nil , nil , InvalidPath ( path ) } ch , err := charm . ReadCharm ( path ) if err != nil { if isNotExistsError ( err ) { return nil , nil , CharmNotFound ( path ) } return nil , nil , err } absPath , err := filepath . Abs ( path ) if err != nil { return nil , nil , err } _ , name := filepath . Split ( absPath ) seriesToUse , err := charmSeries ( series , force , ch ) if err != nil { return nil , nil , err } url := & charm . URL { Schema : " " , Name : name , Series : seriesToUse , Revision : ch . Revision ( ) , } return ch , url , nil }
NewCharmAtPathForSeries returns the charm represented by this path,
and a URL that describes it.
NewCharmAtPathForSeries returns the charm represented by this path and a URL that describes it .