]> Cypherpunks.ru repositories - goredo.git/commitdiff
Always OOD unexistent targets
authorSergey Matveev <stargrave@stargrave.org>
Thu, 14 Oct 2021 10:01:36 +0000 (13:01 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 14 Oct 2021 10:01:36 +0000 (13:01 +0300)
doc/news.texi
ood.go
t/redo-sh.tests/README
t/redo-sh.tests/ood_1/test
t/redo-sh.tests/ood_2/test
t/redo-sh.tests/ood_3/test
usage.go

index ab7b9a14074b160fa555a0384c06ba6298e46fc8..2adfe78785f86613460c3454a4d3e027e01dbc0c 100644 (file)
@@ -1,6 +1,13 @@
 @node News
 @unnumbered News
 
+@anchor{Release 1_16_0}
+@section Release 1.16.0
+@itemize
+@item
+    Unexistent targets are considered always out-of-date, as it should be.
+@end itemize
+
 @anchor{Release 1_15_0}
 @section Release 1.15.0
 @itemize
diff --git a/ood.go b/ood.go
index 64e8bc4b203dff37760186f280eadf46820513e8..9dfed348a1637c88b76419b80dda1a552a9c4546 100644 (file)
--- a/ood.go
+++ b/ood.go
@@ -110,6 +110,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 {
index 336d2a11e3d1e8a097499f48d1126edb4b4cbff4..0ef3ea6a4a2c97e389a19111dff9e90d806faa7e 100644 (file)
@@ -2,3 +2,4 @@ Those tests are taken from http://news.dieweltistgarnichtso.net/bin.git.
 Test parallel_2 removed, because goredo has no --jobs.
 Test always_rebuild_1 removed, because always-target is rebuilt once per run.
 stat call is replaced with portable perl script invocation in ood_*.
+ood_* pay attention that "all" is always OOD.
index 15a14dce7316885586764935fe4501f2f9b3b3ee..c6fd04266de887f6c436a87c15eb66865c6cf733 100755 (executable)
@@ -24,13 +24,13 @@ ood1=$(redo-ood)
 '
 <b read -r b2
 
-ood2=$(redo-ood)
+ood2=$(redo-ood | sed /^all$/d)
 
 test 0 -eq "${a1}"
 test 1 -eq "${b1}"
 test 2 -eq "${b2}"
 
-test -z "${ood1}"
+[ "${ood1}" = "all" ]
 test -n "${ood2}"
 
 . ../stat_inode.rc
index 5b5b135b22bcee5607e2fcb7ba6e4723f14ef41b..68fa91280131378574485526cf62eb3b9348540e 100755 (executable)
@@ -31,14 +31,14 @@ ood1=$(redo-ood)
 '
 <c read -r c2
 
-ood2=$(redo-ood)
+ood2=$(redo-ood | sed /^all$/d)
 
 test 0 -eq "${a1}"
 test 1 -eq "${b1}"
 test 2 -eq "${c1}"
 test 3 -eq "${c2}"
 
-test -z "${ood1}"
+[ "${ood1}" = "all" ]
 test -n "${ood2}"
 
 . ../stat_inode.rc
index 347d53bb1ffe93995c56816e9a5b5de23e1dd125..1f47c508efbe290c3ddd916c639dc5a1bc6013bf 100755 (executable)
@@ -39,7 +39,7 @@ ood1=$(redo-ood)
 >d printf '4\n'
 <d read -r d2
 
-ood2=$(redo-ood)
+ood2=$(redo-ood | sed /^all$/d)
 
 test 0 -eq "${a1}"
 test 1 -eq "${b1}"
@@ -47,7 +47,7 @@ test 2 -eq "${c1}"
 test 3 -eq "${d1}"
 test 4 -eq "${d2}"
 
-test -z "${ood1}"
+[ "${ood1}" = "all" ]
 test -n "${ood2}"
 
 . ../stat_inode.rc
index cb4c75665241f60697d3dfd5baec9264d86b8c30..d8460b9236ad0eec4bfb252d117133fceae876e5 100644 (file)
--- a/usage.go
+++ b/usage.go
@@ -24,7 +24,7 @@ import (
 )
 
 const (
-       Version  = "1.15.0"
+       Version  = "1.16.0"
        Warranty = `Copyright (C) 2020-2021 Sergey Matveev
 
 This program is free software: you can redistribute it and/or modify