/*
goredo -- djb's redo implementation on pure Go
-Copyright (C) 2020-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2020-2022 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
func parseBuildLogRec(dir, tgt string) (map[string][]string, error) {
- fd, err := os.Open(path.Join(dir, RedoDir, tgt+LogSuffix+DepSuffix))
+ fd, err := os.Open(path.Join(dir, RedoDir, tgt+LogRecSuffix))
if err != nil {
return nil, err
}
return w.Flush()
}
defer fd.Close()
- fdDep, err := os.Open(path.Join(dirNormalized, RedoDir, tgtNormalized+DepSuffix))
- if err != nil {
- return err
- }
- depInfo, err := depRead(fdDep)
- fdDep.Close()
- if err != nil {
- return err
- }
- subs := make([]*BuildLogJob, 0, len(depInfo.ifchanges))
- for _, dep := range depInfo.ifchanges {
- subDir, subTgt := cwdAndTgt(path.Join(dirNormalized, dep["Target"]))
+ subs := make([]*BuildLogJob, 0, len(buildLogRec["Ifchange"]))
+ for _, dep := range buildLogRec["Ifchange"] {
+ subDir, subTgt := cwdAndTgt(path.Join(dirNormalized, dep))
if subDir == dirNormalized && subTgt == tgtNormalized {
continue
}
}
subs = append(subs, &BuildLogJob{
dir: dirNormalized,
- tgt: dep["Target"],
+ tgt: dep,
started: started,
exitCode: exitCode,
rec: rec,