X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=blobdiff_plain;f=ood.go;h=c455a3b01e22c3221f0b9a5eccc72db6b83996d0;hp=9dfed348a1637c88b76419b80dda1a552a9c4546;hb=2fe7eaeac99947f761f4665893c09db31d6b3a4b;hpb=f7d92a7b771c73daaba7afcbe73ce98f9c0d2d70 diff --git a/ood.go b/ood.go index 9dfed34..c455a3b 100644 --- a/ood.go +++ b/ood.go @@ -90,6 +90,21 @@ func isSrc(cwd, tgt string) bool { return true } +func isOODByBuildUUID(cwd, tgtOrig string) bool { + cwd, tgt := cwdAndTgt(path.Join(cwd, tgtOrig)) + depPath := path.Join(cwd, RedoDir, tgt+DepSuffix) + fdDep, err := os.Open(depPath) + if err != nil { + return true + } + depInfo, err := depRead(fdDep) + fdDep.Close() + if err != nil || depInfo.build != BuildUUID { + return true + } + return false +} + func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, error) { indent := strings.Repeat(". ", level) trace(CDebug, "ood: %s%s checking", indent, tgtOrig) @@ -215,6 +230,14 @@ func isOODWithTrace( } _, ood := OODTgts[p] if ood { + if !isOODByBuildUUID(cwd, tgtOrig) { + trace( + CDebug, + "ood: %s%s -> already built", + strings.Repeat(". ", level), tgtOrig, + ) + return false, nil + } trace( CDebug, "ood: %s%s true, external decision",