Implement install#914
Merged
Cynede merged 10 commits intouutils:masterfrom Jul 14, 2016
Merged
Conversation
Add install utility skeleton source, based on mv, including the getopts setup mirroring GNU's `man install` documentation. Also add a single test and build system code.
Bare minimum functionality of `install file dir` implemented. Also added TODO markers in code for outstanding parameters and split main function into smaller logical chunks.
We check if the user has given one of the (many) not yet implemented command line arguments. Upon catching this, we display the specific transgressor to stderr and exit with return code 2. This behaviour is tested in one new integration test.
Test this with one integration test. Also document functions and add an '(unimplemented)' marker to some arguments in help.
Tested in two integration test: - One creating three component directories - One trying to create an already existing directory
We now accept symbolic and numeric mode strings using the --mode or -m option for install. This is used either when moving files into a directory, or when creating component directories with the -d option. This feature was designed to mirror the GNU implementation, including the possibly quirky behaviour of `install --mode=u+wx file dir` resulting in dir/file having exactly permissions 0300. Extensive integration tests are included. This chnage required a higher libc dependency.
Contributor
Author
|
If desired, it's an easy change to comment out unimplemented arguments. |
| hostid \ | ||
| hostname \ | ||
| id \ | ||
| install \ |
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.
This pull request implements install, with basic functionality.
Included:
install file1 file2 directory/worksinstall -d comp1 comp2worksinstall --mode=345 file directory/worksTesting:
Notes:
Questions before merge: