diff options
author | Pádraig Brady <P@draigBrady.com> | 2015-11-23 17:11:26 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-11-23 18:06:38 +0000 |
commit | 6df26278d6cf5c6fad04d3fbaed4c06a223fb0bd (patch) | |
tree | 7ba12d8c55aa67520373e668d50d1dfc0a27f27f /tests/misc | |
parent | 9fd0662faa4db68dea4fb4ba3f918b6a8f9598c4 (diff) | |
download | coreutils-6df26278d6cf5c6fad04d3fbaed4c06a223fb0bd.tar.xz |
md5sum,sha*sum: ensure --ignore-missing fails when no file verified
* src/md5sum.c (digest_check): Update a matched_checksums bool upon
matched checksum, and fail (loudly unless --status is specified)
if there were no matches. Also change properly_formatted_lines
to a bool while at it since we don't need to track the plurality.
* tests/misc/md5sum.pl: Add a test case.
Suggested by Jim Meyering.
Diffstat (limited to 'tests/misc')
-rwxr-xr-x | tests/misc/md5sum.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/misc/md5sum.pl b/tests/misc/md5sum.pl index 3a7744bde..40f56077d 100755 --- a/tests/misc/md5sum.pl +++ b/tests/misc/md5sum.pl @@ -143,6 +143,12 @@ my @Tests = "meaningful only when verifying checksums\n". $try_help}, {EXIT=> 1}], + ['check-ignore-missing-5', '--check', '--ignore-missing', + {AUX=> {f=> ''}}, + {IN=> {'f.md5' => "$degenerate missing\n"}}, + {ERR=> + "md5sum: f.md5: no file was verified\n"}, + {EXIT=> 1}], ['bsd-segv', '--check', {IN=> {'z' => "MD5 ("}}, {EXIT=> 1}, {ERR=> "$prog: z: no properly formatted MD5 checksum lines found\n"}], |