Repository navigation
Conversation
Copies files and sets their mode, with -m, -D, -t, -C, -p, -b, -v, the long -- spellings, multiple sources and multiple operands. Operand handling and the copy live in common/install; src/install is a five-line main. The -t option was the subtle part, and it was a real bug rather than a style choice: with -t DIRECTORY the directory belongs to the option, so every operand is a source, and my first version pushed the directory into the operand list, which made the copy try to stat its own destination as an input. -D creates the leading directories before copying, and -C leaves an existing destination alone. Four error diagnostics were compared byte-for-byte against GNU 9.4 through WSL: an invalid mode, no operands at all, a single operand with no destination, and a source that does not exist. All four match, including the quoting around the path. uutils 0.0.17 ships no install for Windows, so there is no TestRig here and WSL is the reference. Not implemented, and refused rather than faked: -s needs an external strip program, -g and -o need Windows account lookup, and --preserve-timestamps copies content but not the times, because V exposes no utime call.
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.
installcopies files and sets their mode, with-m,-D,-t,-C,-p,-b,-v, the long--spellings, multiple sources and multiple operands.Operand handling and the copy live in
common/install;src/installis a five-line main.-twas the subtle part, and it was a real bug rather than a style choice: with-t DIRECTORYthe directory belongs to the option, so every operand is a source. My first version pushed the directory into the operand list, which made the copy try to stat its own destination as an input and fail withcannot stat .: No such file or directory. It is fixed, andtest_parse_args_target_directory_is_not_a_sourcepins it with the bug described in a comment.-Dcreates the leading directories before copying, and-Cleaves an existing destination alone rather than overwriting it.Four error diagnostics were compared byte-for-byte against GNU 9.4 through WSL: an invalid mode, no operands at all, a single operand with no destination, and a source that does not exist. All four match, including the quoting around the path.
uutils 0.0.17 ships no
installfor Windows, so there is no TestRig here and WSL is the reference. That is stated in the test file rather than left implied.One platform note: mode bits map onto the read-only attribute, as with
chmod, and the suite pins that mapping natively because a Windows process cannot set Unix bits on a WSL path. I deliberately did not assert that-m 640yields mode0640here — that would be claiming something the platform cannot do.Not implemented, and refused rather than faked:
-sneeds an externalstripprogram,-gand-oneed Windows account lookup, and--preserve-timestampscopies content but not the times, because V exposes noutimecall.