Пример #1
0
func (pkg *LocalPackage) Clone(newRepo *repo.Repo,
	newName string) *LocalPackage {

	// XXX: Validate name.

	// Copy the package.
	newPkg := *pkg
	newPkg.repo = newRepo
	newPkg.name = newName
	newPkg.basePath = newRepo.Path() + "/" + newPkg.name

	// Insert the clone into the global package map.
	proj := interfaces.GetProject()
	pMap := proj.PackageList()

	(*pMap[newRepo.Name()])[newPkg.name] = &newPkg

	return &newPkg
}
Пример #2
0
func (r *Repo) Init(repoName string, rversreq string, d downloader.Downloader) error {
	var err error

	r.name = repoName
	r.downloader = d
	r.deps = []*RepoDependency{}
	r.versreq, err = LoadVersionMatches(rversreq)
	if err != nil {
		return err
	}

	path := interfaces.GetProject().Path()

	if r.local {
		r.localPath = filepath.Clean(path)
	} else {
		r.localPath = filepath.Clean(path + "/" + REPOS_DIR + "/" + r.name)
	}

	return nil
}
Пример #3
0
func (ps *ProjectState) StateFile() string {
	return interfaces.GetProject().Path() + "/" + PROJECT_STATE_FILE
}
Пример #4
0
func (r *Repo) repoFilePath() string {
	return interfaces.GetProject().Path() + "/" + REPOS_DIR + "/" +
		".configs/" + r.name + "/"
}