Repository navigation
Conversation
When the target directory did not exist, the cut failed with "cannot extract from package "base-files": target directory does not exist", which pointed at the first package being extracted rather than at the directory, and only after the packages were fetched. Check the target directory at the start of slicer.Run and return an error that names it, also covering the case where the path exists but is not a directory. The check in the tarball package is kept, as that package has its own API. Fixes canonical#234.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #234.
When
--rootdoesn't exist, the cut fails only once it extracts the first package, and the error blames that package instead of the directory:This checks the target directory in
slicer.Runas suggested on the issue, before any package is fetched:A path that exists but isn't a directory now gives
target is not a directory: /etc/hostsinstead of amkdirerror. The check intarballstays as it is.I didn't touch #206: the release and archive indexes are still fetched first (#264 and #288 are changing
cmd_cut.go), and creating the directory automatically hasn't been decided. Two new cases inslicer_test.gocover both errors.