X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=ood.go;h=8f3d7798d8ccf718b0e5ae8b9052b179e8ea7ade;hb=9d1ca78917c32c17686d7ea2ef01c6ebcc0f63d8;hp=0c8d506b8ada12b827a8d7c7fba9dae028fbcb5a;hpb=fc065e1408aa2e452699d1bae1a56af9fcc69bec;p=goredo.git diff --git a/ood.go b/ood.go index 0c8d506..8f3d779 100644 --- a/ood.go +++ b/ood.go @@ -26,7 +26,6 @@ import ( "log" "os" "path" - "path/filepath" "strings" "golang.org/x/sys/unix" @@ -79,23 +78,6 @@ func (e TgtError) Error() string { return fmt.Sprintf("%s: %s", e.Tgt, e.Err) } -func cwdMustRel(paths ...string) string { - rel, err := filepath.Rel(Cwd, path.Join(paths...)) - if err != nil { - panic(err) - } - return rel -} - -func cwdAndTgt(tgt string) (string, string) { - cwd, tgt := path.Split(tgt) - cwd, err := filepath.Abs(cwd) - if err != nil { - panic(err) - } - return cwd, tgt -} - func isSrc(cwd, tgt string) bool { d, f := path.Split(path.Join(cwd, tgt)) if !FileExists(path.Join(d, f)) { @@ -270,11 +252,9 @@ func isOODWithTrace( level int, seen map[string]struct{}, ) (bool, error) { - p, err := filepath.Abs(path.Join(cwd, tgtOrig)) - if err != nil { - panic(err) - } + p := mustAbs(path.Join(cwd, tgtOrig)) _, ood := OODTgts[p] + var err error if ood { if !isOODByBuildUUID(cwd, tgtOrig) { tracef(