Skip to content

Commit

Permalink
Rename memo to inputs-digest
Browse files Browse the repository at this point in the history
  • Loading branch information
darkowlzz committed May 30, 2017
1 parent 243be69 commit 6079300
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cmd/dep/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,19 @@ func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
}
}

memoMismatch, hasMissingPkgs, err := runStatusAll(ctx.Loggers, out, p, sm)
digestMismatch, hasMissingPkgs, err := runStatusAll(ctx.Loggers, out, p, sm)
if err != nil {
return err
}

if memoMismatch {
if digestMismatch {
if hasMissingPkgs {
ctx.Loggers.Err.Println("Lock memo mismatch due to the following packages missing from the lock:\n")
ctx.Loggers.Err.Println("Lock inputs-digest mismatch due to the following packages missing from the lock:\n")
ctx.Loggers.Out.Print(buf.String())
ctx.Loggers.Err.Println("\nThis happens when a new import is added. Run `dep ensure` to install the missing packages.")
} else {
ctx.Loggers.Err.Printf("Lock memo mismatch. This happens when Gopkg.toml is modified.\n" +
"Run `dep ensure` to regenerate the memo.")
ctx.Loggers.Err.Printf("Lock inputs-digest mismatch. This happens when Gopkg.toml is modified.\n" +
"Run `dep ensure` to regenerate the inputs-digest.")
}
} else {
ctx.Loggers.Out.Print(buf.String())
Expand All @@ -254,18 +254,18 @@ type MissingStatus struct {
}

func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.SourceManager) (bool, bool, error) {
var memoMismatch, hasMissingPkgs bool
var digestMismatch, hasMissingPkgs bool

if p.Lock == nil {
// TODO if we have no lock file, do...other stuff
return memoMismatch, hasMissingPkgs, nil
return digestMismatch, hasMissingPkgs, nil
}

// While the network churns on ListVersions() requests, statically analyze
// code from the current project.
ptree, err := pkgtree.ListPackages(p.AbsRoot, string(p.ImportRoot))
if err != nil {
return memoMismatch, hasMissingPkgs, errors.Errorf("analysis of local packages failed: %v", err)
return digestMismatch, hasMissingPkgs, errors.Errorf("analysis of local packages failed: %v", err)
}

// Set up a solver in order to check the InputHash.
Expand All @@ -282,7 +282,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So

s, err := gps.Prepare(params, sm)
if err != nil {
return memoMismatch, hasMissingPkgs, errors.Errorf("could not set up solver for input hashing: %s", err)
return digestMismatch, hasMissingPkgs, errors.Errorf("could not set up solver for input hashing: %s", err)
}

cm := collectConstraints(ptree, p, sm)
Expand Down Expand Up @@ -313,7 +313,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So
ptr, err := sm.ListPackages(proj.Ident(), proj.Version())

if err != nil {
return memoMismatch, hasMissingPkgs, fmt.Errorf("analysis of %s package failed: %v", proj.Ident().ProjectRoot, err)
return digestMismatch, hasMissingPkgs, fmt.Errorf("analysis of %s package failed: %v", proj.Ident().ProjectRoot, err)
}

prm, _ := ptr.ToReachMap(true, false, false, nil)
Expand Down Expand Up @@ -375,7 +375,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So
}
out.BasicFooter()

return memoMismatch, hasMissingPkgs, nil
return digestMismatch, hasMissingPkgs, nil
}

// Hash digest mismatch may indicate that some deps are no longer
Expand All @@ -384,7 +384,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So
//
// It's possible for digests to not match, but still have a correct
// lock.
memoMismatch = true
digestMismatch = true
rm, _ := ptree.ToReachMap(true, true, false, nil)

external := rm.FlattenFn(paths.IsStandardImportPath)
Expand Down Expand Up @@ -417,7 +417,7 @@ func runStatusAll(loggers *dep.Loggers, out outputter, p *dep.Project, sm gps.So
loggers.Err.Printf("\t%s: %s\n", fail.ex, fail.err.Error())
}

return memoMismatch, hasMissingPkgs, errors.New("address issues with undeducable import paths to get more status information.")
return digestMismatch, hasMissingPkgs, errors.New("address issues with undeducible import paths to get more status information")
}

out.MissingHeader()
Expand All @@ -437,7 +437,7 @@ outer:
}
out.MissingFooter()

return memoMismatch, hasMissingPkgs, nil
return digestMismatch, hasMissingPkgs, nil
}

func formatVersion(v gps.Version) string {
Expand Down

0 comments on commit 6079300

Please sign in to comment.