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"
19 # todo: this should happen in some kind of sandbox or vm
22 if type -t rustc
&>/dev
/null
; then
25 curl https
://sh.rustup.rs
-sSf | bash
-s -- -y
28 if ! which rg
&>/dev
/null
; then
32 if ! type -t cargo-install-update
&>/dev
/null
; then
34 # error: failed to run custom build command for `openssl-sys v0.9.53`
35 pi libssl-dev pkg-config
36 cargo
install cargo-update
39 cargo install-update
-a