}
// Determine basename and DIRPREFIX
+ doFileRelPath := doFile
ents := strings.Split(cwd, "/")
ents = ents[len(ents)-upLevels:]
dirPrefix := path.Join(ents...)
cwdOrig := cwd
for i := 0; i < upLevels; i++ {
cwd = path.Join(cwd, "..")
+ doFileRelPath = path.Join("..", doFileRelPath)
}
cwd = path.Clean(cwd)
doFilePath := path.Join(cwd, doFile)
runErr := RunErr{Tgt: tgtOrig}
if strings.HasPrefix(doFile, "default.") {
basename = tgt[:len(tgt)-(len(doFile)-len("default.")-len(".do"))-1]
- runErr.DoFile = doFile
+ runErr.DoFile = doFileRelPath
}
- if err = writeDep(fdDep, cwd, doFile); err != nil {
+ if err = writeDep(fdDep, cwdOrig, doFileRelPath); err != nil {
cleanup()
return TgtErr{tgtOrig, err}
}