cf-remote currently downloads packages to ~/.cfengine/cf-remote/packages/ and then uses ssh / scp to transfer the file to the host.
We should add an option: cf-remote install --remote-download which causes cf-remote to run the appropriate curl command on the host instead. (So the package is downloaded directly to the target machine). New option should be added here:
This function will be used to run curl on remote host:
This function can be updated to handle pkg which is a URL, not a local file path:
This part will need to be skipped if the new --remote-download option is used:
Additionally, in the case where no package URL is specified and automatic selection is done, this part needs to be skipped:
(So that the package is not downloaded locally, but the URL is kept to be downloaded on the host).
This is the part where package is transferred from local to remote:
For --remote-download it can be replaced with running the curl command over ssh, as explained above.