rclone/cmd
lostheli c8cfa43ccc Add a download flag to hashsum and related commands to force rclone to download and hash files locally
This commit modifies the operations.hashSum function by adding an alternate code path. This code path is triggered by passing downloadFlag = True. When activated, rclone will download files from the remote and hash them locally. downloadFlag = False preserves the existing behavior of using the remote to retrieve the hash.

This commit modifies HashLister to support the new hashSum method as well as consolidating the roles of HashLister, HashListerBase64, Md5sum, and Sha1sum.  The printing of hashes from the function defined in HashLister has been revised to work with --progress.  There are light changes to operations.syncFprintf and cmd.startProgress for this.

The unit test operations_test.TestHashSums is modified to support this change and test the download functionality.

The command functions hashsum, md5sum, sha1sum, and dbhashsum are modified to support this change.  A download flag has been added and an output-file flag has been added.  The output-file flag writes hashes to a file instead of stdout to avoid the need to redirect stdout.
2020-12-27 15:40:44 +00:00
..
about docs: update rclone about docs 2020-11-27 14:08:52 +00:00
all backend: add new backend command for backend specific commands 2020-04-29 10:10:57 +01:00
authorize config: add context.Context #3257 #4685 2020-11-09 18:05:54 +00:00
backend fs: Add context to NewFs #3257 #4685 2020-11-09 18:05:54 +00:00
cachestats build: make rclone build with wasm 2020-08-10 17:32:21 +01:00
cat docs: restore lost spelling fixes 2020-02-10 15:29:39 +00:00
check check: fix docs 2020-09-07 12:10:52 +01:00
cleanup docs: Add full stops for consistency in rclone --help 2020-09-08 16:26:09 +01:00
cmount cmount: don't call host.Umount if a signal has been received 2020-11-29 17:44:00 +00:00
config fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
copy docs: Add full stops for consistency in rclone --help 2020-09-08 16:26:09 +01:00
copyto docs: Add full stops for consistency in rclone --help 2020-09-08 16:26:09 +01:00
copyurl doc: fix typos throughout docs and code 2020-05-20 15:54:51 +01:00
cryptcheck check,cryptcheck: add reporting of filenames for same/missing/changed #3264 2020-07-21 22:08:13 +01:00
cryptdecode crypt: get rid of the unused Cipher interface as it obfuscated the code 2020-04-22 11:33:48 +01:00
dbhashsum Add a download flag to hashsum and related commands to force rclone to download and hash files locally 2020-12-27 15:40:44 +00:00
dedupe dedupe: add --dedupe-mode list to just list dupes, changing nothing 2020-12-02 16:52:12 +00:00
delete docs: update documentation of commands delete,purge,rmdir,rmdirs 2020-11-23 17:10:08 +00:00
deletefile cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
genautocomplete docs: spelling: e.g. 2020-10-28 18:16:23 +00:00
gendocs docs: remove manually set dates and use git dates instead 2020-06-01 13:07:46 +01:00
hashsum Add a download flag to hashsum and related commands to force rclone to download and hash files locally 2020-12-27 15:40:44 +00:00
info fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
link link: Add --expire and --unlink flags 2020-06-05 14:51:05 +01:00
listremotes cmd: fix environment variables not setting command line flags 2019-10-14 17:02:09 +01:00
ls docs: grammar: examples are examples 2020-10-28 18:16:23 +00:00
lsd fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
lsf fs: Add context to NewFs #3257 #4685 2020-11-09 18:05:54 +00:00
lsjson docs: spelling: etc. 2020-10-28 18:16:23 +00:00
lsl cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
md5sum Add a download flag to hashsum and related commands to force rclone to download and hash files locally 2020-12-27 15:40:44 +00:00
memtest cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
mkdir mkdir: warn when using mkdir on remotes which can't have empty directories 2020-07-08 17:55:58 +01:00
mount mount: add "." and ".." to directories to match cmount and expectations 2020-12-17 12:14:22 +00:00
mount2 docs: spelling: e.g. 2020-10-28 18:16:23 +00:00
mountlib mountlib: make sure we don't call umount more than once #4804 2020-11-29 17:44:00 +00:00
move docs: spelling: server-side 2020-10-28 18:16:23 +00:00
moveto docs: promote the use of -i/--interactive and "rclone sync -i" everywhere #1574 2020-06-10 12:33:53 +01:00
ncdu fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
obscure docs: Add full stops for consistency in rclone --help 2020-09-08 16:26:09 +01:00
purge docs: update documentation of commands delete,purge,rmdir,rmdirs 2020-11-23 17:10:08 +00:00
rc fshttp: read config from ctx not passed in ConfigInfo #4685 2020-11-26 16:40:12 +00:00
rcat cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
rcd fs: Add context to NewFs #3257 #4685 2020-11-09 18:05:54 +00:00
reveal cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
rmdir docs: update documentation of commands delete,purge,rmdir,rmdirs 2020-11-23 17:10:08 +00:00
rmdirs docs: update documentation of commands delete,purge,rmdir,rmdirs 2020-11-23 17:10:08 +00:00
serve rc: prefer actual listener address if using ":port" or "addr:0" only 2020-12-26 16:28:54 +00:00
settier cmd: fix spelling of Definition 2019-10-14 17:02:09 +01:00
sha1sum Add a download flag to hashsum and related commands to force rclone to download and hash files locally 2020-12-27 15:40:44 +00:00
size cmd: fix environment variables not setting command line flags 2019-10-14 17:02:09 +01:00
sync docs: promote the use of -i/--interactive and "rclone sync -i" everywhere #1574 2020-06-10 12:33:53 +01:00
touch docs: spelling: e.g. 2020-10-28 18:16:23 +00:00
tree fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
version version: replace internal code with github.com/coreos/go-semver 2020-08-31 13:55:04 +01:00
cmd.go log: fix enabling systemd logging when using --log-file 2020-12-17 11:55:27 +00:00
help.go fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
progress.go Add a download flag to hashsum and related commands to force rclone to download and hash files locally 2020-12-27 15:40:44 +00:00
siginfo_darwin.go cmd: fix up stats printing on macOS after accounting change 2019-07-28 20:38:20 +01:00
siginfo_others.go cmd: add siginfo handler 2018-06-02 17:35:13 +01:00