]> Cypherpunks repositories - goredo.git/commitdiff
Do not always OOD .do with default.do v2.8.0
authorSergey Matveev <stargrave@stargrave.org>
Tue, 16 Dec 2025 13:07:31 +0000 (16:07 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 16 Dec 2025 13:31:27 +0000 (16:31 +0300)
doc/news.texi
ood.go
t/goredo-do-ood.t [new file with mode: 0755]
usage.go

index f01a56a89cc206507b3a58dca9704302207e431d..49cc825967b50ee38eb70bc02ed862d43274e78d 100644 (file)
@@ -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 110a105c41b39ab567297a90616555eb080445bf..b1eaadcaa9c779eedfd05b3941fb7c2079baba03 100644 (file)
--- 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 (executable)
index 0000000..81995bd
--- /dev/null
@@ -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
index fac6ee55ce539ce50da98b3ac25b1b1af9bc14b3..5088201f73528ad10d9e9561556fbcf3a3cfbe51 100644 (file)
--- 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