From 6878431ad32eb879e46478290b8bafdaa2b0240b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 18 Jan 2023 15:09:37 +0300 Subject: [PATCH] Fix wrong OOD cache value of the source file --- doc/news.texi | 8 ++++++++ ood.go | 12 +++++++++--- usage.go | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/news.texi b/doc/news.texi index 769c375..d519c7d 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -2,6 +2,14 @@ @cindex news @unnumbered News +@anchor{Release 1_30_0} +@section Release 1.30.0 +@itemize +@item + Fixed wrong OOD-cache value of source file dependency. + Targets could be rebuilt without any reason. +@end itemize + @anchor{Release 1_29_0} @section Release 1.29.0 @itemize diff --git a/ood.go b/ood.go index 25253ce..b46ea63 100644 --- a/ood.go +++ b/ood.go @@ -137,9 +137,15 @@ func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, erro depPath := path.Join(cwd, RedoDir, tgt+DepSuffix) fdDep, err := os.Open(depPath) if err != nil { - tracef(CDebug, "ood: %s%s -> no dep: %s", indent, tgtOrig, depPath) - OODCache[path.Join(cwd, tgt)] = true - return true, nil + if isSrc(cwd, tgt) { + ood = false + tracef(CDebug, "ood: %s%s -> is source", indent, tgtOrig) + } else { + ood = true + tracef(CDebug, "ood: %s%s -> no dep: %s", indent, tgtOrig, depPath) + } + OODCache[path.Join(cwd, tgt)] = ood + return ood, nil } depInfo, err := depRead(fdDep) fdDep.Close() diff --git a/usage.go b/usage.go index ec46d58..e67077f 100644 --- a/usage.go +++ b/usage.go @@ -24,7 +24,7 @@ import ( ) const ( - Version = "1.29.0" + Version = "1.30.0" Warranty = `Copyright (C) 2020-2023 Sergey Matveev This program is free software: you can redistribute it and/or modify -- 2.44.0