From a3c6ee7d9525b24b4a71c83fba891ae0669459e1 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 16 Dec 2025 16:07:31 +0300 Subject: [PATCH] Do not always OOD .do with default.do --- doc/news.texi | 7 +++++++ ood.go | 4 ++++ t/goredo-do-ood.t | 12 ++++++++++++ usage.go | 2 +- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 t/goredo-do-ood.t diff --git a/doc/news.texi b/doc/news.texi index f01a56a..49cc825 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -2,6 +2,13 @@ @cindex news @unnumbered News +@anchor{Release 2_8_0} +@section Release 2.8.0 +@itemize +@item + Fix always-OOD @file{.do}-targets with nearby @file{default.do}. +@end itemize + @anchor{Release 2_7_0} @section Release 2.7.0 @itemize diff --git a/ood.go b/ood.go index 110a105..b1eaadc 100644 --- a/ood.go +++ b/ood.go @@ -25,6 +25,7 @@ import ( "io/fs" "log" "os" + "path" "strings" "golang.org/x/sys/unix" @@ -103,6 +104,9 @@ func isOOD(tgt *Tgt, level int, seen map[string]*Tgt) (bool, error) { if isSrc(tgt) { ood = false tracef(CDebug, "ood: %s%s -> is source", indent, tgt) + } else if path.Ext(tgt.a) == ".do" { + ood = false + tracef(CDebug, "ood: %s%s -> is .do", indent, tgt) } else { ood = true tracef(CDebug, "ood: %s%s -> no dep: %s", indent, tgt, tgt.dep) diff --git a/t/goredo-do-ood.t b/t/goredo-do-ood.t new file mode 100755 index 0000000..81995bd --- /dev/null +++ b/t/goredo-do-ood.t @@ -0,0 +1,12 @@ +#!/bin/sh + +test_description="Check OOD of .do target" +. $SHARNESS_TEST_SRCDIR/sharness.sh +export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1 + +echo echo foo >foo.do +echo echo default >default.do +redo foo +test_expect_success "!ood" '[ -z "$(redo-ood foo)" ]' + +test_done diff --git a/usage.go b/usage.go index fac6ee5..5088201 100644 --- a/usage.go +++ b/usage.go @@ -22,7 +22,7 @@ import ( ) const ( - Version = "2.7.0" + Version = "2.8.0" Warranty = `Copyright (C) 2020-2026 Sergey Matveev This program is free software: you can redistribute it and/or modify -- 2.52.0