X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=sources.go;h=659df3a51d9ff76e352dcbc104b62e7d01a8be6b;hb=9d1ca78917c32c17686d7ea2ef01c6ebcc0f63d8;hp=b7dcfd473d0add22302afd8560972b7000feb64c;hpb=fc065e1408aa2e452699d1bae1a56af9fcc69bec;p=goredo.git diff --git a/sources.go b/sources.go index b7dcfd4..659df3a 100644 --- a/sources.go +++ b/sources.go @@ -21,16 +21,12 @@ import ( "log" "os" "path" - "path/filepath" ) func sourcesWalker(tgts []string) ([]string, error) { seen := make(map[string]struct{}, 1<<10) for _, tgt := range tgts { - tgtAbsPath, err := filepath.Abs(path.Join(Cwd, tgt)) - if err != nil { - panic(err) - } + tgtAbsPath := mustAbs(path.Join(Cwd, tgt)) cwd, f := path.Split(path.Join(Cwd, tgt)) fdDep, err := os.Open(path.Join(cwd, RedoDir, f+DepSuffix)) if err != nil { @@ -46,10 +42,7 @@ func sourcesWalker(tgts []string) ([]string, error) { } for _, m := range depInfo.ifchanges { depTgt := m["Target"] - depTgtAbsPath, err := filepath.Abs(path.Join(cwd, depTgt)) - if err != nil { - panic(err) - } + depTgtAbsPath := mustAbs(path.Join(cwd, depTgt)) if isSrc(cwd, depTgt) { seen[cwdMustRel(depTgtAbsPath)] = struct{}{} } else if depTgtAbsPath != tgtAbsPath {