source
- main.go: Try to ensure directory for given `cachedir` path.
- context.go: Create the default cache directory, `$GOPATH/pkg/dep`, if the
user did not override it.
- source_manager.go: Use `fs.EnsureDir` instead of `os.MkdirAll` for creating
sources folder in cache directory.
- fs.go:
- Add func `EnsureDir` to create a directory if it does not exist.
- Remove func `IsValidPath`.
test
- integration_test.go: Improve tests for invalid cache directory.
- fs_test.go: Add test for `EnsureDir`, remove test for `IsValidPath`.
- manager_test.go: fix TestSourceManagerInit
- Re-create cache directory before trying to call `NewSourceManager` the 2nd
time and defer it's removal.
- If `NewSourceManager` fails the 2nd time, exit the error using `t.Fatal` to
avoid panic in `sm.Release`
misc
- language - {fallback => default} for cachedir
- fs.go - Add method `IsValidPath` to check if given file path string is valid.
Add tests as well.
- main.go - After loading cachedir from env, if it has been set, check
validity, exit with status 1 if not. Update integration tests for this
scenario.
source
- main.go: Read and use env var `DEPCACHEDIR` for instantiating dep context.
- context.go:
- Add field `Cachedir` to struct `Ctx`. This holds the value of env var
`DEPCACHEDIR`.
- Use `Ctx.Cachedir` while instantiating `gps.SourceMgr` if present, fallback
to `$GOPATH/pkg/dep` otherwise.
- source_manager.go: Add a getter func `Cachedir` to facilitate testing in
`context_test.go`.
test
- context_test.go Add test to check `gps.SourceMgr` is instantiated with
appropriate `cachedir`.
- integration_test.go: Add test to check environment variable `DEPCACHEDIR` is
loaded and used if present.
misc
- update changelog
This is crude, but it will restore output context to various git errors,
which has been crippling. We desperately need to work on formatting
these errors better.
Errors from collectConstraints() should not result in failure of status.
These errors are logged to stderr and the error count is added to
`errCount` of `runStatusAll()`. This results in letting the user know
about incomplete status result, keeping the status output clean. Running
status in verbose mode would show all those errors.
collectConstraints(), used by `dep status`, was trying to do on-the-fly
conversions of existing tools. That needs to remain disabled until we
also turn it on for `dep init` and `dep ensure`.