[PATCH] rclone needs a flag to exit nonzero when a file is not found
Sean Whitton
spwhitton at spwhitton.name
Tue Jun 15 21:49:31 BST 2021
Hello,
On Sun 13 Jun 2021 at 10:31AM -10, nathan todd-stone wrote:
> Sure!
>
> I've just switched all my repos from rsync and servers to rclone and s3. In doing so, I encountered an issue with the rclone backend, and fixed it with this patch.
>
> The rclone cli needs a flag to exit nonzero when a file is not found, this flag is --error-on-no-transfer. The help states:
>
> >> rclone help flags | grep error-on
> --error-on-no-transfer Sets exit code 9 if no files are transferred, useful in scripts
>
> The git-remote-gcrypt functions GET and PUT are both expected to exit nonzero on failure, and without this flag, they always exit zero when rclone is used, even when a file is not found.
>
> My initial failure was on line 544: GET "$URL" "$Manifestfile" "$tmp_manifest" 2>| "$tmp_stderr" || {.
>
> GET was returning zero even when the remote file was not found, and later a "No such file or directory" error would occur trying to read "$tmp_manifest", which had never been written.
>
> With this flag, rclone exits nonzero when a remote file is missing for GET, or a local file is missing for PUT. This has fixed rclone so far for me, and is likely all that is needed.
Pushed, thank you.
--
Sean Whitton
More information about the sgo-software-discuss
mailing list