s/vsolver/gps/g
diff --git a/action/get.go b/action/get.go
index 3c900ae..2e6a05d 100644
--- a/action/get.go
+++ b/action/get.go
@@ -15,7 +15,7 @@
"github.com/Masterminds/glide/repo"
"github.com/Masterminds/glide/util"
"github.com/Masterminds/semver"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
)
// Get fetches one or more dependencies and installs.
@@ -37,13 +37,14 @@
msg.Die("Could not find the vendor dir: %s", err)
}
- args := vsolver.SolveArgs{
- Name: vsolver.ProjectName(conf.ProjectName),
+ args := gps.SolveArgs{
+ Name: gps.ProjectName(conf.ProjectName),
Root: filepath.Dir(glidefile),
Manifest: conf,
+ Ignore: conf.Ignore,
}
- opts := vsolver.SolveOpts{
+ opts := gps.SolveOpts{
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
}
@@ -60,7 +61,7 @@
}
// Create the SourceManager for this run
- sm, err := vsolver.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
+ sm, err := gps.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
defer sm.Release()
if err != nil {
msg.Err(err.Error())
@@ -80,7 +81,7 @@
}
// Prepare a solver. This validates our args and opts.
- s, err := vsolver.Prepare(args, opts, sm)
+ s, err := gps.Prepare(args, opts, sm)
if err != nil {
msg.Err("Aborted get - could not set up solver to reconcile dependencies: %s", err)
return
@@ -134,7 +135,7 @@
// - sets up insecure repo URLs where necessary
// - generates a list of subpackages
func addPkgsToConfig(conf *cfg.Config, names []string, insecure, nonInteract, testDeps bool) (int, error) {
- // TODO refactor this to take and use a vsolver.SourceManager
+ // TODO refactor this to take and use a gps.SourceManager
if len(names) == 1 {
msg.Info("Preparing to install %d package.", len(names))
} else {
@@ -202,7 +203,7 @@
dep := &cfg.Dependency{
Name: root,
- Constraint: vsolver.Any(),
+ Constraint: gps.Any(),
}
// When retriving from an insecure location set the repo to the
diff --git a/action/install.go b/action/install.go
index 96ade7f..9afb974 100644
--- a/action/install.go
+++ b/action/install.go
@@ -13,7 +13,7 @@
"github.com/Masterminds/glide/msg"
gpath "github.com/Masterminds/glide/path"
"github.com/Masterminds/glide/repo"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
)
// Install installs a vendor directory based on an existing Glide configuration.
@@ -31,33 +31,31 @@
}
// Create the SourceManager for this run
- sm, err := vsolver.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
+ sm, err := gps.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
defer sm.Release()
if err != nil {
msg.Err(err.Error())
return
}
- args := vsolver.SolveArgs{
- Name: vsolver.ProjectName(conf.ProjectName),
- Root: filepath.Dir(vend),
- Manifest: conf,
- }
-
- opts := vsolver.SolveOpts{
+ params := gps.SolveParameters{
+ Name: gps.ProjectName(conf.ProjectName),
+ Root: filepath.Dir(vend),
+ Manifest: conf,
+ Ignore: conf.Ignore,
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
}
- var s vsolver.Solver
+ var s gps.Solver
if gpath.HasLock(base) {
- args.Lock, err = LoadLockfile(base, conf)
+ params.Lock, err = LoadLockfile(base, conf)
if err != nil {
msg.Err("Could not load lockfile.")
return
}
- s, err = vsolver.Prepare(args, opts, sm)
+ s, err = gps.Prepare(params, opts, sm)
if err != nil {
msg.Err("Could not set up solver: %s", err)
return
@@ -65,7 +63,7 @@
digest, err := s.HashInputs()
// Check if digests match, and warn if they don't
- if bytes.Equal(digest, args.Lock.InputHash()) {
+ if bytes.Equal(digest, params.Lock.InputHash()) {
if so {
msg.Err("glide.yaml is out of sync with glide.lock")
return
@@ -75,7 +73,7 @@
}
gw := safeGroupWriter{
- resultLock: args.Lock,
+ resultLock: params.Lock,
vendor: vend,
sm: sm,
stripVendor: sv,
@@ -91,7 +89,7 @@
return
} else {
// There is no lock, so we have to solve first
- s, err = vsolver.Prepare(args, opts, sm)
+ s, err = gps.Prepare(params, sm)
if err != nil {
msg.Err("Could not set up solver: %s", err)
return
@@ -145,8 +143,8 @@
type safeGroupWriter struct {
conf *cfg.Config
lock *cfg.Lockfile
- resultLock vsolver.Lock
- sm vsolver.SourceManager
+ resultLock gps.Lock
+ sm gps.SourceManager
glidefile, vendor string
stripVendor bool
}
@@ -235,7 +233,7 @@
}
if writeVendor {
- err = vsolver.CreateVendorTree(filepath.Join(td, "vendor"), gw.resultLock, gw.sm, gw.stripVendor)
+ err = gps.CreateVendorTree(filepath.Join(td, "vendor"), gw.resultLock, gw.sm, gw.stripVendor)
if err != nil {
return fmt.Errorf("Error while generating vendor tree: %s", err)
}
diff --git a/action/update.go b/action/update.go
index ecd00d6..f792e03 100644
--- a/action/update.go
+++ b/action/update.go
@@ -10,7 +10,7 @@
"github.com/Masterminds/glide/msg"
gpath "github.com/Masterminds/glide/path"
"github.com/Masterminds/glide/repo"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
)
// Update updates repos and the lock file from the main glide yaml.
@@ -30,13 +30,14 @@
msg.Die("Could not find the vendor dir: %s", err)
}
- args := vsolver.SolveArgs{
- Name: vsolver.ProjectName(conf.ProjectName),
+ args := gps.SolveArgs{
+ Name: gps.ProjectName(conf.ProjectName),
Root: filepath.Dir(vend),
Manifest: conf,
+ Ignore: conf.Ignore,
}
- opts := vsolver.SolveOpts{
+ opts := gps.SolveOpts{
Trace: true,
TraceLogger: log.New(os.Stdout, "", 0),
}
@@ -49,7 +50,7 @@
if !conf.HasDependency(p) {
msg.Die("Cannot update %s, as it is not listed as dependency in glide.yaml.", p)
}
- opts.ToChange = append(opts.ToChange, vsolver.ProjectName(p))
+ opts.ToChange = append(opts.ToChange, gps.ProjectName(p))
}
}
@@ -62,15 +63,15 @@
}
// Create the SourceManager for this run
- sm, err := vsolver.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
- defer sm.Release()
+ sm, err := gps.NewSourceManager(dependency.Analyzer{}, filepath.Join(installer.Home, "cache"), base, false)
if err != nil {
msg.Err(err.Error())
return
}
+ defer sm.Release()
// Prepare a solver. This validates our args and opts.
- s, err := vsolver.Prepare(args, opts, sm)
+ s, err := gps.Prepare(args, opts, sm)
if err != nil {
msg.Err("Could not set up solver: %s", err)
return
diff --git a/cfg/config.go b/cfg/config.go
index 221e9ec..6dc42a5 100644
--- a/cfg/config.go
+++ b/cfg/config.go
@@ -10,7 +10,7 @@
"github.com/Masterminds/glide/util"
"github.com/Masterminds/vcs"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
"gopkg.in/yaml.v2"
)
@@ -163,21 +163,21 @@
}
// DependencyConstraints lists all the non-test dependency constraints
-// described in a glide manifest in a way vsolver will understand.
-func (c *Config) DependencyConstraints() []vsolver.ProjectDep {
+// described in a glide manifest in a way gps will understand.
+func (c *Config) DependencyConstraints() []gps.ProjectDep {
return depsToVSolver(c.Imports)
}
// TestDependencyConstraints lists all the test dependency constraints described
-// in a glide manifest in a way vsolver will understand.
-func (c *Config) TestDependencyConstraints() []vsolver.ProjectDep {
+// in a glide manifest in a way gps will understand.
+func (c *Config) TestDependencyConstraints() []gps.ProjectDep {
return depsToVSolver(c.DevImports)
}
-func depsToVSolver(deps Dependencies) []vsolver.ProjectDep {
- cp := make([]vsolver.ProjectDep, len(deps))
+func depsToVSolver(deps Dependencies) []gps.ProjectDep {
+ cp := make([]gps.ProjectDep, len(deps))
for k, d := range deps {
- var c vsolver.Constraint
+ var c gps.Constraint
var err error
// Support both old and new. TODO handle this earlier
@@ -187,26 +187,26 @@
// TODO need to differentiate types of constraints so that we don't have
// this ambiguity
// Try semver first
- c, err = vsolver.NewSemverConstraint(d.Reference)
+ c, err = gps.NewSemverConstraint(d.Reference)
if err != nil {
// Not a semver constraint. Super crappy heuristic that'll cover hg
// and git revs, but not bzr (svn, you say? lol, madame. lol)
if len(d.Reference) == 40 {
- c = vsolver.Revision(d.Reference)
+ c = gps.Revision(d.Reference)
} else {
// Otherwise, assume a branch. This also sucks, because it could
// very well be a shitty, non-semver tag.
- c = vsolver.NewBranch(d.Reference)
+ c = gps.NewBranch(d.Reference)
}
}
}
- id := vsolver.ProjectIdentifier{
- LocalName: vsolver.ProjectName(d.Name),
+ id := gps.ProjectIdentifier{
+ LocalName: gps.ProjectName(d.Name),
NetworkName: d.Repository,
}
- cp[k] = vsolver.ProjectDep{
+ cp[k] = gps.ProjectDep{
Ident: id,
Constraint: c,
}
@@ -216,8 +216,8 @@
}
// Name returns the name of the project given in the manifest.
-func (c *Config) Name() vsolver.ProjectName {
- return vsolver.ProjectName(c.ProjectName)
+func (c *Config) Name() gps.ProjectName {
+ return gps.ProjectName(c.ProjectName)
}
// HasIgnore returns true if the given name is listed on the ignore list.
@@ -441,7 +441,7 @@
// Dependency describes a package that the present package depends upon.
type Dependency struct {
Name string `yaml:"package"`
- Constraint vsolver.Constraint `yaml:"-"` // TODO temporary, for experimenting; reconcile with other data
+ Constraint gps.Constraint `yaml:"-"` // TODO temporary, for experimenting; reconcile with other data
Reference string `yaml:"version,omitempty"`
Pin string `yaml:"-"`
Repository string `yaml:"repo,omitempty"`
@@ -484,12 +484,12 @@
// TODO this covers git & hg; bzr and svn (??) need love
if len(r) == 40 {
if _, err := hex.DecodeString(r); err == nil {
- d.Constraint = vsolver.Revision(r)
+ d.Constraint = gps.Revision(r)
}
} else {
- d.Constraint, err = vsolver.NewSemverConstraint(r)
+ d.Constraint, err = gps.NewSemverConstraint(r)
if err != nil {
- d.Constraint = vsolver.NewVersion(r)
+ d.Constraint = gps.NewVersion(r)
}
}
@@ -497,14 +497,14 @@
return fmt.Errorf("Error on creating constraint for %q from %q: %s", d.Name, r, err)
}
} else if newDep.Branch != "" {
- d.Constraint = vsolver.NewBranch(newDep.Branch)
+ d.Constraint = gps.NewBranch(newDep.Branch)
if err != nil {
return fmt.Errorf("Error on creating constraint for %q from %q: %s", d.Name, newDep.Branch, err)
}
} else {
// TODO this is just for now - need a default branch constraint type
- d.Constraint = vsolver.Any()
+ d.Constraint = gps.Any()
}
d.Repository = newDep.Repository
@@ -548,7 +548,7 @@
}
// Pull out the correct type of constraint
- if v, ok := d.Constraint.(vsolver.Version); ok {
+ if v, ok := d.Constraint.(gps.Version); ok {
switch v.Type() {
case "any":
// Do nothing; nothing here is taken as 'any'
@@ -557,7 +557,7 @@
case "revision", "semver", "version":
newDep.Reference = v.String()
}
- } else if vsolver.IsAny(d.Constraint) {
+ } else if gps.IsAny(d.Constraint) {
// We do nothing here, as the way any gets represented is with no
// constraint information at all
// TODO for now, probably until we add first-class 'default branch'
diff --git a/cfg/lock.go b/cfg/lock.go
index 65b5252..11a15c9 100644
--- a/cfg/lock.go
+++ b/cfg/lock.go
@@ -9,7 +9,7 @@
"time"
"github.com/Masterminds/semver"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
"gopkg.in/yaml.v2"
)
@@ -22,8 +22,8 @@
DevImports Locks `yaml:"testImports"`
}
-// LockfileFromSolverLock transforms a vsolver.Lock into a glide *Lockfile.
-func LockfileFromSolverLock(r vsolver.Lock) *Lockfile {
+// LockfileFromSolverLock transforms a gps.Lock into a glide *Lockfile.
+func LockfileFromSolverLock(r gps.Lock) *Lockfile {
if r == nil {
return nil
}
@@ -46,7 +46,7 @@
}
v := p.Version()
- if pv, ok := v.(vsolver.PairedVersion); ok {
+ if pv, ok := v.(gps.PairedVersion); ok {
l.Version = pv.Underlying().String()
} else {
l.Version = v.String()
@@ -99,29 +99,29 @@
}
// Projects returns the list of projects enumerated in the lock file.
-func (lf *Lockfile) Projects() []vsolver.LockedProject {
+func (lf *Lockfile) Projects() []gps.LockedProject {
all := append(lf.Imports, lf.DevImports...)
- lp := make([]vsolver.LockedProject, len(all))
+ lp := make([]gps.LockedProject, len(all))
for k, l := range all {
// TODO guess the version type. ugh
- var v vsolver.Version
+ var v gps.Version
// semver first
_, err := semver.NewVersion(l.Version)
if err == nil {
- v = vsolver.NewVersion(l.Version)
+ v = gps.NewVersion(l.Version)
} else {
// Crappy heuristic to cover hg and git, but not bzr. Or (lol) svn
if len(l.Version) == 40 {
- v = vsolver.Revision(l.Version)
+ v = gps.Revision(l.Version)
} else {
// Otherwise, assume it's a branch
- v = vsolver.NewBranch(l.Version)
+ v = gps.NewBranch(l.Version)
}
}
- lp[k] = vsolver.NewLockedProject(vsolver.ProjectName(l.Name), v, l.Repository, l.Name, nil)
+ lp[k] = gps.NewLockedProject(gps.ProjectName(l.Name), v, l.Repository, l.Name, nil)
}
return lp
diff --git a/dependency/analyzer.go b/dependency/analyzer.go
index a3da972..36994b7 100644
--- a/dependency/analyzer.go
+++ b/dependency/analyzer.go
@@ -13,7 +13,7 @@
"github.com/Masterminds/glide/gom"
"github.com/Masterminds/glide/gpm"
gpath "github.com/Masterminds/glide/path"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
)
type notApplicable struct{}
@@ -22,12 +22,12 @@
return ""
}
-// Analyzer implements vsolver.ProjectAnalyzer. We inject the Analyzer into a
-// vsolver.SourceManager, and it reports manifest and lock information to the
+// Analyzer implements gps.ProjectAnalyzer. We inject the Analyzer into a
+// gps.SourceManager, and it reports manifest and lock information to the
// SourceManager on request.
type Analyzer struct{}
-func (a Analyzer) GetInfo(ctx build.Context, pn vsolver.ProjectName) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) GetInfo(ctx build.Context, pn gps.ProjectName) (gps.Manifest, gps.Lock, error) {
// For now, at least, we do not search above the root path provided by
// the SourceManager.
root := filepath.Join(ctx.GOPATH, "src", string(pn))
@@ -82,12 +82,12 @@
}
// If none of our parsers matched, but none had actual errors, then we just
- // go hands-off; vsolver itself will do the source analysis and use the Any
+ // go hands-off; gps itself will do the source analysis and use the Any
// constraint for all discovered package.
return nil, nil, nil
}
-func (a Analyzer) lookForGlide(root string) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) lookForGlide(root string) (gps.Manifest, gps.Lock, error) {
mpath := filepath.Join(root, gpath.GlideFile)
if _, err := os.Lstat(mpath); err != nil {
return nil, nil, notApplicable{}
@@ -126,7 +126,7 @@
return m, l, nil
}
-func (a Analyzer) lookForGodep(root string) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) lookForGodep(root string) (gps.Manifest, gps.Lock, error) {
if !godep.Has(root) {
return nil, nil, notApplicable{}
}
@@ -139,7 +139,7 @@
return &cfg.Config{ProjectName: root, Imports: d}, l, nil
}
-func (a Analyzer) lookForGPM(root string) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) lookForGPM(root string) (gps.Manifest, gps.Lock, error) {
if !gpm.Has(root) {
return nil, nil, notApplicable{}
}
@@ -152,7 +152,7 @@
return &cfg.Config{ProjectName: root, Imports: d}, l, nil
}
-func (a Analyzer) lookForGb(root string) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) lookForGb(root string) (gps.Manifest, gps.Lock, error) {
if !gpm.Has(root) {
return nil, nil, notApplicable{}
}
@@ -165,7 +165,7 @@
return &cfg.Config{ProjectName: root, Imports: d}, l, nil
}
-func (a Analyzer) lookForGom(root string) (vsolver.Manifest, vsolver.Lock, error) {
+func (a Analyzer) lookForGom(root string) (gps.Manifest, gps.Lock, error) {
if !gpm.Has(root) {
return nil, nil, notApplicable{}
}
diff --git a/godep/godep.go b/godep/godep.go
index 2e16670..2b9ea41 100644
--- a/godep/godep.go
+++ b/godep/godep.go
@@ -128,7 +128,7 @@
seen[pkg] = true
// Place no real *actual* constraint on the project; instead, we
- // rely on vsolver using the 'preferred' version mechanism by
+ // rely on gps using the 'preferred' version mechanism by
// working from the lock file. Without this, users would end up with
// the same mind-numbing diamond dep problems as currently exist.
// This approach does make for an uncomfortably wide possibility
diff --git a/gom/gom.go b/gom/gom.go
index 36b2bde..677b874 100644
--- a/gom/gom.go
+++ b/gom/gom.go
@@ -9,7 +9,7 @@
"github.com/Masterminds/glide/msg"
gpath "github.com/Masterminds/glide/path"
"github.com/Masterminds/glide/util"
- "github.com/sdboyer/vsolver"
+ "github.com/sdboyer/gps"
)
// Has returns true if this dir has a Gomfile.
@@ -92,7 +92,7 @@
}
// AsMetadataPair attempts to extract manifest and lock data from gom metadata.
-func AsMetadataPair(dir string) (vsolver.Manifest, vsolver.Lock, error) {
+func AsMetadataPair(dir string) (gps.Manifest, gps.Lock, error) {
path := filepath.Join(dir, "Gomfile")
if _, err := os.Stat(path); err != nil {
return nil, nil, err
@@ -103,9 +103,9 @@
return nil, nil, err
}
- var l vsolver.SimpleLock
- m := vsolver.SimpleManifest{
- N: vsolver.ProjectName(dir),
+ var l gps.SimpleLock
+ m := gps.SimpleManifest{
+ N: gps.ProjectName(dir),
}
for _, gom := range goms {
@@ -130,9 +130,9 @@
pkg, _ := util.NormalizeName(gom.name)
- dep := vsolver.ProjectDep{
- Ident: vsolver.ProjectIdentifier{
- LocalName: vsolver.ProjectName(pkg),
+ dep := gps.ProjectDep{
+ Ident: gps.ProjectIdentifier{
+ LocalName: gps.ProjectName(pkg),
},
}
@@ -142,37 +142,37 @@
// - Branch
// - Revision
- var v vsolver.UnpairedVersion
+ var v gps.UnpairedVersion
if val, ok := gom.options["tag"]; ok {
body := val.(string)
- v = vsolver.NewVersion(body)
- c, err := vsolver.NewSemverConstraint(body)
+ v = gps.NewVersion(body)
+ c, err := gps.NewSemverConstraint(body)
if err != nil {
- c = vsolver.NewVersion(body)
+ c = gps.NewVersion(body)
}
dep.Constraint = c
} else if val, ok := gom.options["branch"]; ok {
body := val.(string)
- v = vsolver.NewBranch(body)
- dep.Constraint = vsolver.NewBranch(body)
+ v = gps.NewBranch(body)
+ dep.Constraint = gps.NewBranch(body)
}
if val, ok := gom.options["commit"]; ok {
body := val.(string)
if v != nil {
- v.Is(vsolver.Revision(body))
- l = append(l, vsolver.NewLockedProject(vsolver.ProjectName(dir), v, dir, dir, nil))
+ v.Is(gps.Revision(body))
+ l = append(l, gps.NewLockedProject(gps.ProjectName(dir), v, dir, dir, nil))
} else {
// As with the other third-party system integrations, we're
// going to choose not to put revisions into a manifest, even
// though gom has a lot more information than most and the
// argument could be made for it.
- dep.Constraint = vsolver.Any()
- l = append(l, vsolver.NewLockedProject(vsolver.ProjectName(dir), vsolver.Revision(body), dir, dir, nil))
+ dep.Constraint = gps.Any()
+ l = append(l, gps.NewLockedProject(gps.ProjectName(dir), gps.Revision(body), dir, dir, nil))
}
} else if v != nil {
// This is kinda uncomfortable - lock w/no immut - but OK
- l = append(l, vsolver.NewLockedProject(vsolver.ProjectName(dir), v, dir, dir, nil))
+ l = append(l, gps.NewLockedProject(gps.ProjectName(dir), v, dir, dir, nil))
}
// TODO We ignore GOOS, GOARCH for now
diff --git a/gpm/gpm.go b/gpm/gpm.go
index 111ca25..00ca864 100644
--- a/gpm/gpm.go
+++ b/gpm/gpm.go
@@ -79,7 +79,7 @@
parts, ok := parseGodepsLine(scanner.Text())
if ok {
// Place no actual constraint on the project; rely instead on
- // vsolver's 'preferred version' reasoning from deps' lock
+ // gps's 'preferred version' reasoning from deps' lock
// files...if we have one at all.
if len(parts) > 1 {
l.Imports = append(l.Imports, &cfg.Lock{Name: parts[0], Version: parts[1]})