Mercurial > hg > toybox
comparison toys/lsb/md5sum.c @ 1499:319e79bab052 draft
Separate more commands so single.sh can build them standalone.
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 26 Sep 2014 18:42:23 -0500 |
parents | d90f692a50d4 |
children | 62a7d617e1ce |
comparison
equal
deleted
inserted
replaced
1498:d965dfbee154 | 1499:319e79bab052 |
---|---|
7 * | 7 * |
8 * They're combined this way to share infrastructure, and because md5sum is | 8 * They're combined this way to share infrastructure, and because md5sum is |
9 * and LSB standard command, sha1sum is just a good idea. | 9 * and LSB standard command, sha1sum is just a good idea. |
10 | 10 |
11 USE_MD5SUM(NEWTOY(md5sum, "b", TOYFLAG_USR|TOYFLAG_BIN)) | 11 USE_MD5SUM(NEWTOY(md5sum, "b", TOYFLAG_USR|TOYFLAG_BIN)) |
12 USE_MD5SUM_SHA1SUM(OLDTOY(sha1sum, md5sum, "b", TOYFLAG_USR|TOYFLAG_BIN)) | 12 USE_SHA1SUM(NEWTOY(sha1sum, "b", TOYFLAG_USR|TOYFLAG_BIN)) |
13 | 13 |
14 config MD5SUM | 14 config MD5SUM |
15 bool "md5sum" | 15 bool "md5sum" |
16 default y | 16 default y |
17 help | 17 help |
21 Output one hash (16 hex digits) for each input file, followed by | 21 Output one hash (16 hex digits) for each input file, followed by |
22 filename. | 22 filename. |
23 | 23 |
24 -b brief (hash only, no filename) | 24 -b brief (hash only, no filename) |
25 | 25 |
26 config MD5SUM_SHA1SUM | 26 config SHA1SUM |
27 bool "sha1sum" | 27 bool "sha1sum" |
28 default y | 28 default y |
29 depends on MD5SUM | |
30 help | 29 help |
31 usage: sha1sum [FILE]... | 30 usage: sha1sum [FILE]... |
32 | 31 |
33 calculate sha1 hash for each input file, reading from stdin if none. | 32 calculate sha1 hash for each input file, reading from stdin if none. |
34 Output one hash (20 hex digits) for each input file, followed by | 33 Output one hash (20 hex digits) for each input file, followed by |
239 | 238 |
240 void md5sum_main(void) | 239 void md5sum_main(void) |
241 { | 240 { |
242 loopfiles(toys.optargs, do_hash); | 241 loopfiles(toys.optargs, do_hash); |
243 } | 242 } |
243 | |
244 void sha1sum_main(void) | |
245 { | |
246 md5sum_main(); | |
247 } |