2 # Copyright (C) 2019 Ian Kelling
3 # SPDX-License-Identifier: AGPL-3.0-or-later
5 if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
7 shopt -s inherit_errexit
2>/dev
/null ||
: # ignore fail in bash < 4.4
9 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
10 # alternatively, using https://iankelling.org/git/?p=errhandle;a=tree
11 # source /path/errhandle/err
13 source /a
/bin
/errhandle
/err
14 source /a
/bin
/distro-functions
/src
/package-manager-abstractions
16 PATH
="$PATH:$HOME/.cargo/bin"
20 if type -t rustc
&>/dev
/null
; then
23 curl https
://sh.rustup.rs
-sSf | bash
-s -- -y
25 # todo: update this. updates in rust are stupidly complicate
26 if ! which rg
&>/dev
/null
; then
30 if ! type -t cargo-install-update
&>/dev
/null
; then
32 # error: failed to run custom build command for `openssl-sys v0.9.53`
33 pi libssl-dev pkg-config
34 cargo
install cargo-update
37 cargo install-update
-a