From: Sergey Matveev Date: Sat, 30 Sep 2023 17:50:34 +0000 (+0300) Subject: Empty target names must not be present in .rec X-Git-Tag: v2.0.0~30 X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=commitdiff_plain;h=c03c318031de26da3ca8e8af5f50f04727a85e91 Empty target names must not be present in .rec --- diff --git a/dep.go b/dep.go index 0add0a7..6644ac5 100644 --- a/dep.go +++ b/dep.go @@ -206,6 +206,10 @@ func depRead(pth string) (*DepInfo, error) { } depInfo.ifcreates = append(depInfo.ifcreates, dep) case DepTypeIfchange: + dep := m["Target"] + if dep == "" { + return nil, ErrBadRecFormat + } inode, err := inodeFromRec(m) if err != nil { log.Print(err) @@ -213,7 +217,7 @@ func depRead(pth string) (*DepInfo, error) { } hsh := mustHexDecode(m["Hash"]) depInfo.ifchanges = append(depInfo.ifchanges, DepInfoIfchange{ - tgt: m["Target"], inode: inode, hash: hsh, + tgt: dep, inode: inode, hash: hsh, }) case DepTypeStamp: hsh := m["Hash"] diff --git a/ifchange.go b/ifchange.go index 84bd260..bfe65f1 100644 --- a/ifchange.go +++ b/ifchange.go @@ -58,9 +58,6 @@ func collectDeps( } } for _, dep := range depInfo.ifchanges { - if dep.tgt == "" { - return alwayses - } if dep.tgt == tgt { continue } diff --git a/ood.go b/ood.go index 3843fa1..5dc543f 100644 --- a/ood.go +++ b/ood.go @@ -149,9 +149,6 @@ func isOOD(cwd, tgtOrig string, level int, seen map[string]struct{}) (bool, erro } for _, dep := range depInfo.ifchanges { - if dep.tgt == "" { - return ood, TgtError{tgtOrig, ErrMissingTarget} - } tracef(CDebug, "ood: %s%s -> %s: checking", indent, tgtOrig, dep.tgt) ood, cached = OODCache[path.Join(cwd, dep.tgt)] if cached {