Commit 2ac32b63 authored by Lynn Boger's avatar Lynn Boger Committed by Ian Lance Taylor

cmd/go: improve stale reason for packages

This adds more information to the pkg stale reason for debugging
purposes.

Change-Id: I7b626db4520baa1127195ae859f4da9b49304636
Reviewed-on: https://go-review.googlesource.com/36944Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c05b06a1
......@@ -1507,7 +1507,13 @@ func isStale(p *Package) (bool, string) {
// Package is stale if a dependency is.
for _, p1 := range p.Internal.Deps {
if p1.Stale {
return true, "stale dependency"
// Don't add "stale dependency" if it is
// already there.
if strings.HasPrefix(p1.StaleReason, "stale dependency") {
return true, p1.StaleReason
}
msg := fmt.Sprintf("stale dependency %s: %s", p1.Name, p1.StaleReason)
return true, msg
}
}
......@@ -1545,7 +1551,8 @@ func isStale(p *Package) (bool, string) {
// Package is stale if a dependency is, or if a dependency is newer.
for _, p1 := range p.Internal.Deps {
if p1.Internal.Target != "" && olderThan(p1.Internal.Target) {
return true, "newer dependency"
msg := fmt.Sprintf("newer dependency %s ", p1.Internal.Target)
return true, msg
}
}
......@@ -1612,7 +1619,8 @@ func isStale(p *Package) (bool, string) {
srcs := str.StringList(p.GoFiles, p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.CgoFiles, p.SysoFiles, p.SwigFiles, p.SwigCXXFiles)
for _, src := range srcs {
if olderThan(filepath.Join(p.Dir, src)) {
return true, "newer source file"
msg := fmt.Sprintf("newer source file %s", filepath.Join(p.Dir, src))
return true, msg
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment