Esempio n. 1
0
func addProfileAndTargets(t *testing.T, pdb *profiles.DB, name string) {
	t1, _ := profiles.NewTarget("cpu1-os1@1", "A=B,C=D")
	t2, _ := profiles.NewTarget("cpu2-os2@bar", "A=B,C=D")
	pdb.InstallProfile("test", name, "")
	if err := pdb.AddProfileTarget("test", name, t1); err != nil {
		t.Fatal(err)
	}
	t2.InstallationDir = "bar"
	if err := pdb.AddProfileTarget("test", name, t2); err != nil {
		t.Fatal(err)
	}
}
Esempio n. 2
0
func (eg *exampleManager) Install(jirix *jiri.X, pdb *profiles.DB, root jiri.RelPath, target profiles.Target) error {
	version, err := eg.versionInfo.Select(target.Version())
	if err != nil {
		return err
	}
	target.SetVersion(version)
	dir := eg.filename(root, target).Abs(jirix)
	if err := jirix.NewSeq().
		MkdirAll(dir, profilesutil.DefaultDirPerm).
		WriteFile(filepath.Join(dir, "version"), []byte(version), profilesutil.DefaultFilePerm).
		WriteFile(filepath.Join(dir, version), []byte(version), profilesutil.DefaultFilePerm).
		Done(); err != nil {
		return err
	}
	eg.profile = pdb.InstallProfile(eg.installer, eg.name, string(root))
	target.InstallationDir = string(root)
	return pdb.AddProfileTarget(eg.installer, eg.name, target)
}
Esempio n. 3
0
func (p *myNewProfileMgr) Install(jirix *jiri.X, pdb *profiles.DB, root jiri.RelPath, target profiles.Target) error {
	p.profile = pdb.InstallProfile(p.name, "", "root")
	return pdb.AddProfileTarget(p.name, "", target)
}