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) } }
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) }
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) }