Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Update gps to v0.16.0 #382

Merged
merged 3 commits into from
Apr 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

[[dependencies]]
name = "github.com/sdboyer/gps"
version = ">=0.15.0, <1.0.0"
version = ">=0.16.0, <1.0.0"
6 changes: 3 additions & 3 deletions analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/sdboyer/gps"
)

type analyzer struct{}
type Analyzer struct{}

func (a analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
func (a Analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Manifest, gps.Lock, error) {
// TODO: If we decide to support other tools manifest, this is where we would need
// to add that support.
mf := filepath.Join(path, ManifestName)
Expand All @@ -36,6 +36,6 @@ func (a analyzer) DeriveManifestAndLock(path string, n gps.ProjectRoot) (gps.Man
return m, nil, nil
}

func (a analyzer) Info() (string, int) {
func (a Analyzer) Info() (string, int) {
return "dep", 1
}
4 changes: 2 additions & 2 deletions analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestDeriveManifestAndLock(t *testing.T) {
want := h.GetTestFileString(golden)
h.TempCopy(filepath.Join("dep", ManifestName), golden)

a := analyzer{}
a := Analyzer{}

m, l, err := a.DeriveManifestAndLock(h.Path("dep"), "my/fake/project")
if err != nil {
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestDeriveManifestAndLockDoesNotExist(t *testing.T) {
}
defer os.RemoveAll(dir)

a := analyzer{}
a := Analyzer{}

m, l, err := a.DeriveManifestAndLock(dir, "my/fake/project")
if m != nil || l != nil || err != nil {
Expand Down
5 changes: 1 addition & 4 deletions cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,8 @@ func getProjectConstraint(arg string, sm *gps.SourceMgr) (gps.ProjectConstraint,
var found bool
for _, version := range versions {
if versionStr == version.String() {
if pv, ok := version.(gps.PairedVersion); ok {
version = pv.Unpair()
}
found = true
constraint.Constraint = version
constraint.Constraint = version.Unpair()
break
}
}
Expand Down
1 change: 1 addition & 0 deletions cmd/dep/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (cmd *initCommand) Run(ctx *dep.Ctx, args []string) error {
RootPackageTree: pkgT,
Manifest: m,
Lock: l,
ProjectAnalyzer: dep.Analyzer{},
}

if *verbose {
Expand Down
11 changes: 2 additions & 9 deletions cmd/dep/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,14 @@ func runStatusAll(out outputter, p *dep.Project, sm *gps.SourceMgr) error {

vl, err := sm.ListVersions(proj.Ident())
if err == nil {
gps.SortForUpgrade(vl)
gps.SortPairedForUpgrade(vl)

for _, v := range vl {
// Because we've sorted the version list for
// upgrade, the first version we encounter that
// matches our constraint will be what we want.
if c.Constraint.Matches(v) {
// For branch constraints this should be the
// most recent revision on the selected
// branch.
if tv, ok := v.(gps.PairedVersion); ok && v.Type() == gps.IsBranch {
bs.Latest = tv.Underlying()
} else {
bs.Latest = v
}
bs.Latest = v.Underlying()
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewContext() (*Ctx, error) {
}

func (c *Ctx) SourceManager() (*gps.SourceMgr, error) {
return gps.NewSourceManager(analyzer{}, filepath.Join(c.GOPATH, "pkg", "dep"))
return gps.NewSourceManager(filepath.Join(c.GOPATH, "pkg", "dep"))
}

// LoadProject takes a path and searches up the directory tree for
Expand Down
3 changes: 2 additions & 1 deletion project.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ type Project struct {
// any nils incorrectly.
func (p *Project) MakeParams() gps.SolveParameters {
params := gps.SolveParameters{
RootDir: p.AbsRoot,
RootDir: p.AbsRoot,
ProjectAnalyzer: Analyzer{},
}

if p.Manifest != nil {
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/sdboyer/constext/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions vendor/github.com/sdboyer/constext/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 123 additions & 0 deletions vendor/github.com/sdboyer/constext/constext.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading