X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=ood.go;h=c455a3b01e22c3221f0b9a5eccc72db6b83996d0;hb=4274dce3366cee45bfaccbe5ca340ce6efe68e00;hp=64e8bc4b203dff37760186f280eadf46820513e8;hpb=9c7d2ee7e4847ba9194f2e96ec460b8c024e551f;p=goredo.git diff --git a/ood.go b/ood.go index 64e8bc4..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) @@ -110,6 +125,10 @@ func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, erro trace(CDebug, "ood: %s%s -> already built", indent, tgtOrig) return false, nil } + if _, err := os.Stat(path.Join(cwd, tgt)); err != nil && os.IsNotExist(err) { + trace(CDebug, "ood: %s%s -> non-existent", indent, tgtOrig) + return true, nil + } ood := false for _, dep := range depInfo.ifcreates { @@ -211,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",