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)
}
_, 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",
--- /dev/null
+#!/bin/sh
+
+testname=`basename "$0"`
+test_description="Passed known OOD targets must not skip BuildUUID check"
+. $SHARNESS_TEST_SRCDIR/sharness.sh
+export REDO_TOP_DIR="`pwd`" REDO_NO_PROGRESS=1
+
+echo redo-ifchange l3 l2 > l1.do
+echo redo-ifchange l3 > l2.do
+cat > l3.do <<EOF
+sleep 1
+touch \$(date +%s).touch
+EOF
+
+redo -j 1 l1
+touches="$(ls *.touch | wc -l)"
+
+test_expect_success "only single .touch exists" '[ $touches = 1 ]'
+
+test_done