Repository navigation
cmd: rclone selfupdate - #5080
Conversation
5cb3947 to
abefc3a
Compare
d4f9e8d to
f386616
Compare
|
Should we also add a note in the Docs that the manpages will no longer be accurate after the binary is updated using this? |
I will add this warning in the success message |
|
As expected Windows has a quirk. It will never allow to rewrite a currently running executable, even if user has full write permissions. On Unix the command will detect incomplete write permissions in advance, but in this case the command will exit with code 1, keep the downloaded file (it will by default have The workaround for scheduled update tasks is to use the |
|
This seems like a reasonable alternative way of accomplishing it: https://stackoverflow.com/a/55247459/3476387 |
|
The rename trick works great, and it is also possible to tell Windows to automatically delete it on next startup, simply by adding the path into registry value HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations. Not that it is very important in this case, but just an idea.. Edit: Seems like Chocolatey (package manager) uses this method. Could not find it clearly documented anywhere, but basing it on the discussions in this issue: chocolatey/choco#1768 |
|
I would like to have the first released version of the command have only the required features, release it as fast as possible and leave optional features for later enhancements. |
This comment has been minimized.
This comment has been minimized.
Sure. BTW: It's exposed as an Windows API function, MoveFileEx with flag
I agree. Have not really decided myself what I would want (delete rclone.exe.old on boot or not), but just wanted to note it in case it could turn up useful.. Great work btw! |
This comment has been minimized.
This comment has been minimized.
|
Based on the discussion in https://forum.rclone.org/t/rclone-cmount-on-linux/22602 the official build of rclone for Linux does not support |
Implementation details:
All unit tests pass for me @ncw @albertony @darthShadow |
Summary of new changes after 1st review:
@ncw |
|
TODO will create an RFC issue for the MoveFileEx aka MOVEFILE_DELAY_UNTIL_REBOOT feature requested in #5080 (comment) when we merge this pull. UPD: Done |
[snip] Great changes :-) I'll run through a code review now.
I think this should do it Which produced I've attached a zip with the ascii version and the binary version too just in case you want the binary version. |
ncw
left a comment
There was a problem hiding this comment.
That is looking really nice :-)
I put a couple of docs comments inline.
Well done!
d1723a5 to
12eefff
Compare
|
PGP signature validation - implemented. The only minor thing left is name for the flag: --package vs --format Will now proceed on to |
|
Testing the I added (locally) the following into InstallUpdate (the executable update part, did not consider the package update): |
I put some suggested text in the comment above
:-) |
I think Let's add more flag combinations to cover your use cases with an output like below:
I think that |
|
All requests addressed. |
Implements self-update command Fixes rclone#548 Fixes rclone#5076
What is the purpose of this change?
Implements
rclone self-updatecommand (ticket #548)Flags and features:
--output- downloads new executable to a custom location--beta- self-explanatory--check- just an alias ofrclone version --checkYet unimplemented, left for future patches:
--stable(--backports)--versionUPDATE 2021-03-08:
Will be implemented:
--stable(mutually exclusive with--beta)--version VER(micro-release autocompletion if stable)--package deb(linux only)--package rpm(linux only)Was the change discussed in an issue or in the forum before?
Yes:
Checklist