blob: 4b4bc099b3e1d484f37d4847aa5e74f2bbb6002a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/usr/bin/env bash
#
# Usage:
# maint/apt-install [--] PACKAGE...
#
# Runs `apt-get update` and `apt-get -y install PACKAGE...`.
#
# (Doesn't run `apt-get update` more than once in the same CI run:
# by looking for a `.maint-apt-install-apt-update-done` stamp file.)
set -euo pipefail
# this include stanza is automatically maintained by update-shell-includes
common_dir=$(realpath "$0")
common_dir=$(dirname "$common_dir")
# shellcheck source=maint/common/bash-utils.sh
. "$common_dir"/bash-utils.sh
reject_options
stamp=.maint-apt-install-apt-update-done
if ! test -e "$stamp"; then
x apt-get update
touch "$stamp"
fi
x apt-get install -y -- "$@"
|