Cargoで導入したRustパッケージをcargo-updateで一括更新

cargo install で導入したものを一括アップデートしたいなと思い cargo-update を試してみました.

install
$ cargo install cargo-update
help
$ cargo install-update --help
cargo-install-update 15.0.0
наб <nabijaczleweli@nabijaczleweli.xyz>
Yann Simon <yann.simon.fr@gmail.com>
ven <vendethiel@hotmail.fr>
Cat Plus Plus <piotrlegnica@piotrl.pl>
Liigo <liigo@qq.com>
azyobuzin <azyobuzin@users.sourceforge.jp>
Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Tom Prince <tom.prince@twistedmatrix.com>
Mateusz Mikuła <mati865@gmail.com>
sinkuu <sinkuupump@gmail.com>
Alex Burka <aburka@seas.upenn.edu>
Matthias Krüger <matthias.krueger@famsik.de>
Daniel Holbert <dholbert@cs.stanford.edu>
Jonas Bushart <jonas@bushart.org>
Harrison Metzger <harrisonmetz@gmail.com>
Benjamin Bannier <bbannier@gmail.com>
Dimitris Apostolou <dimitris.apostolou@icloud.com>
Corbin Uselton <corbinu@decimal.io>
QuarticCat <QuarticCat@protonmail.com>
Artur Sinila <freesoftware@logarithmus.dev>
qthree <qthree3@gmail.com>
Marcin Puc <tranzystorek.io@protonmail.com>
Paul Barker <paul@pbarker.dev>
Benoît CORTIER <bcortier@proton.me>
Biswapriyo Nath <nathbappai@gmail.com>
Shiraz <smcclennon@protonmail.com>
Victor Song <vms2@rice.edu>
chrisalcantara <chris@chrisalcantara.com>
Utkarsh Gupta <utkarshgupta137@gmail.com>
nevsal
A cargo subcommand for checking and applying updates to installed executables

USAGE:
    cargo install-update [OPTIONS] [--] [PACKAGE]...

ARGS:
    <PACKAGE>...    Packages to update

OPTIONS:
    -a, --all                           Update all packages
    -c, --cargo-dir <CARGO_DIR>         The cargo home directory. Default: $CARGO_HOME or $HOME/.cargo [aliases: root]
    -d, --downdate                      Downdate packages to match latest unyanked registry version
    -f, --force                         Update all packages regardless if they need updating
    -g, --git                           Also update git packages
    -h, --help                          Print help information
    -i, --allow-no-update               Allow for fresh-installing packages
    -j, --jobs <JOBS>                   Limit number of parallel jobs.
    -l, --list                          Don't update packages, only list and check if they need an update (all packages by default)
        --locked                        Enforce packages' embedded Cargo.lock
    -q, --quiet                         No output printed to stdout
    -r, --install-cargo <EXECUTABLE>    Specify an alternative cargo to run for installations
    -s, --filter <PACKAGE_FILTER>       Specify a filter a package must match to be considered
    -t, --temp-dir <TEMP_DIR>           The temporary directory. Default: $TEMP/cargo-update
    -V, --version                       Print version information

-l / --list でアップデートの確認ができます.

$ cargo install-update --list
    Polling registry 'https://index.crates.io/'.........

Package       Installed  Latest   Needs update
impala        v0.2.1     v0.2.3   Yes
pik           v0.7.0     v0.9.0   Yes
sniffnet      v1.0.1     v1.3.1   Yes
tuisky        v0.0.5     v0.1.2   Yes
zeitfetch     v0.1.12    v0.1.13  Yes
cargo-update  v15.0.0    v15.0.0  No
monolith      v2.8.3     v2.8.3   No
tui-journal   v0.12.0    v0.12.0  No
zellij        v0.40.1    v0.40.1  No

-a / --all でアップデートできるようです.
index アップデート,ダウンロード,コンパイルが実行されます.

$ cargo install-update --all
    Polling registry 'https://index.crates.io/'.........
    :

再度 -l / --list で確認すると Installed と Latest が同じになり,Needs update が全て No になっています.最新になったようです.

$ cargo install-update --list
    Polling registry 'https://index.crates.io/'.........

Package       Installed  Latest   Needs update
cargo-update  v15.0.0    v15.0.0  No
impala        v0.2.3     v0.2.3   No
monolith      v2.8.3     v2.8.3   No
pik           v0.9.0     v0.9.0   No
sniffnet      v1.3.1     v1.3.1   No
tui-journal   v0.12.0    v0.12.0  No
tuisky        v0.1.2     v0.1.2   No
zeitfetch     v0.1.13    v0.1.13  No
zellij        v0.40.1    v0.40.1  No

大分楽になりました.

環境
$ dpkg-query -W cargo
cargo   1.81.0+dfsg1-2
$ lsb_release -dr
Description:    Debian GNU/Linux trixie/sid
Release:        n/a
$ arch
x86_64

One thought to “Cargoで導入したRustパッケージをcargo-updateで一括更新”

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)