nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Support for git-installed packages #51

Closed vorner closed 7 years ago

vorner commented 7 years ago

Hello

Sometimes, I want to install a binary that is not on crates.io, or I want to keep on the very bleeding edge, so I install it with:

cargo install --git https://github.com/whatever/program

Now, it would be great if cargo update could also keep this thing up to date, by checking the installed hash or something and reinstall if master or other relevant branch moves forward.

However, I don't know if it is at all possible (eg. if the git hash is stored somewhere during the installation, for example).

nabijaczleweli commented 7 years ago

Do you have an example of a program that works for you, because error: failed to parse crate metadata is the only thing that happens when installing from git because :software:?

vorner commented 7 years ago

For example I just reinstalled alacritty this way:

cargo install -f --git https://github.com/jwilm/alacritty

What I would like now is that cargo install-update --all would update it whenever there are new commits in the repository.

nabijaczleweli commented 7 years ago

Righty-ho' cargo keeps having issues with parsing metadata for some reason :v

Can you provide (i.e. post) your ~/.cargo/.crates.toml, then?

vorner commented 7 years ago

Yes, of course, here it is:

[v1]
"alacritty 0.1.0 (git+https://github.com/jwilm/alacritty#5f7885749c4d7e48869b1fc0be4d430601cdbbfa)" = ["alacritty"]
"cargo-bundle 0.1.0 (git+https://github.com/burtonageo/cargo-bundle#e69b33ee00ba64a8efe36d2fb99418486d3bc16f)" = ["cargo-bundle"]
"cargo-check 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-check"]
"cargo-expand 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-expand"]
"cargo-outdated 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-outdated"]
"cargo-update 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-install-update", "cargo-install-update-config"]
"cargo-watch 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-watch"]
"clippy 0.0.165 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-clippy"]
"compile-commands-post 0.1.0 (git+https://github.com/vorner/jsonrpc-param-ord#c9be6ebb397c473643f508a2be4fb325c6db6ed8)" = ["compile-commands-post"]
"jsonrpc-param-ord 0.1.0 (path+file:///home/vorner/prog/jsonrpc-param-ord/jsonrpc-param-ord)" = ["jsonrpc-param-ord"]
"pgz 0.1.0 (git+https://github.com/vorner/pgz#f7ea6361ad6afb7eb2abb9b9b7abcc04bc3ad171)" = ["pgz"]
"racer 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = ["racer"]
"ripgrep 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["rg"]
"runner 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["runner"]
"rustfmt 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-fmt", "rustfmt"]
"svgbob_cli 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["svgbob"]
"xargo 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = ["xargo"]
nabijaczleweli commented 7 years ago

Can you try current master with https://github.com/nabijaczleweli/cargo-update/commit/5065b285fe04274a182882828a7e06390fea0aab?

vorner commented 7 years ago

Thanks a lot, it seems to be doing something sane :-). I'll keep watching it just in case.

nabijaczleweli commented 7 years ago

Released in v1.3.0