Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Create rget pin subcommand #32

Open
philips opened this issue Aug 19, 2019 · 3 comments
Open

Create rget pin subcommand #32

philips opened this issue Aug 19, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@philips
Copy link
Collaborator

philips commented Aug 19, 2019

There needs to be a way for a user to save the digest of the files received and ensure that if fetched again that the contents match the last digest. There are a few uses for that:

  • Telling a friend to download something: send the file over email
  • Downloading dependencies for a software build: check the file into git

Rough UX of what I am thinking:

Append to the file if this URL is missing, otherwise verify

rget --pin-file rget.sum https://github.com/etcd-io/etcd/releases/download/v3.3.13/etcd-v3.3.13-darwin-amd64.zip

Append/create URL entry to a pin file for a given URL:

rget pin https://github.com/etcd-io/etcd/releases/download/v3.3.13/etcd-v3.3.13-darwin-amd64.zip
@philips philips added the enhancement New feature or request label Aug 19, 2019
@mkmik
Copy link

mkmik commented Sep 3, 2019

I guess it would be also useful to pass the hash of the single file being downloaded directly as a parameter.

If the receiver trust the instructions, a single copy paste would suffice:

rget --hash b41491157076ccfa52e7b9b0ee695afd24c5d720ea9e40933ef908e69ec19368 \
  https://github.com/etcd-io/etcd/releases/download/v3.3.13/etcd-v3.3.13-darwin-amd64.zip

I did something similar in https://github.com/mkmik/runck, but also conflating the issue of executing an installer (as a proof of concept for an alternative to curl | bash)

@philips
Copy link
Collaborator Author

philips commented Sep 3, 2019

@mkmik yes, I agree both are needed. I don't know what to do if the pin db and the flag provided disagree though. Issue a warning? Exit?

@mkmik
Copy link

mkmik commented Sep 3, 2019

@philips perhaps we can start making those flags mutually exclusive?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants