Directly write the output of the hashing command into the file #4096
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.
Pull Request check list
Affected functionality
checksum file generation approach, output should be identical.
Description of change
Directly write the output of the hashing command into the checksum files.
This avoids the cut and pasting that we do to take the hash from the hashing algorithm and format it with the file from the trimmed full-file path. It does so by opening a sub-shell, changing directory to the parent of the file to be hashed, generating the hash on the file name only (relative to the current working directory), and then writing the output to the checksum file.
This avoids the need to cut the hashing output to get the hash so we can then reconstruct the hash line with a file name lacking parent directories. This will greatly improve the ability of the --check command to work, as now we don't alter the format of the sha256sum line.
Which issue this PR fixes
Fixes #4095