diff --git a/tools/test-setup.sh b/tools/test-setup.sh index 869db09f..7b594598 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -68,7 +68,7 @@ if [[ -f "/usr/bin/apt-get" ]]; then INSTALL=0 # qemu-user-static is required by podman on arm64 # python3-dev is needed for headers as some packages might need to compile - DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static) + DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils) for DEB in "${DEBS[@]}"; do [[ "$(dpkg-query --show --showformat='${db:Status-Status}\n' \ "${DEB}" || true)" != 'installed' ]] && INSTALL=1 diff --git a/tools/vscode.sh b/tools/vscode.sh index e6cc1962..c6a91171 100755 --- a/tools/vscode.sh +++ b/tools/vscode.sh @@ -16,6 +16,31 @@ asdf local nodejs latest:18 unset VIRTUAL_ENV +if [[ -f "/usr/bin/apt-get" ]]; then + INSTALL=0 + # qemu-user-static is required by podman on arm64 + # python3-dev is needed for headers as some packages might need to compile + DEBS=(curl git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils) + for DEB in "${DEBS[@]}"; do + [[ "$(dpkg-query --show --showformat='${db:Status-Status}\n' \ + "${DEB}" || true)" != 'installed' ]] && INSTALL=1 + done + if [[ "${INSTALL}" -eq 1 ]]; then + log warning "We need sudo to install some packages: ${DEBS[*]}" + # mandatory or other apt-get commands fail + sudo apt-get update -qq -o=Dpkg::Use-Pty=0 + # avoid outdated ansible and pipx + sudo apt-get remove -y ansible pipx || true + # install all required packages + sudo apt-get -qq install -y \ + --no-install-recommends \ + --no-install-suggests \ + -o=Dpkg::Use-Pty=0 "${DEBS[@]}" + fi +fi +# log notice "Using $(python3 --version)" +log notice "xvfb installation done" + cleanup() { rv=$? pgrep xvfb-run | xargs --no-run-if-empty sudo kill || true