From 99698bf15c95d7b714605f39959cef62aba4cc20 Mon Sep 17 00:00:00 2001 From: Neil O'Toole Date: Sun, 24 Sep 2023 17:27:42 -0600 Subject: [PATCH] install.sh: xbps-install (void linux) support (#317) * install.sh: xbps-install (void linux) support --- .github/workflows/test-install.yml | 18 ++++++++++++++++++ install.sh | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 7bdda4f3..46999b21 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -182,6 +182,24 @@ jobs: exit 1 fi + void-linux: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + container: ghcr.io/void-linux/void-glibc:latest + steps: + - name: Test install + run: |- + set -e + (xbps-install -Syu || true) && xbps-install -yu xbps curl + /bin/sh -c "$(curl -fsSL https://sq.io/install.sh)" + if [ $(sq version | awk '{print $1}') != "sq" ]; then + # NOTE: The Void package release is a manual process. + # Thus, the released version will not match this particular + # workflow release. We'll just do a simple test here. + echo "FAIL: sq install not working for some reason" + exit 1 + fi + windows-scoop: runs-on: windows-latest if: startsWith(github.ref, 'refs/tags/v') diff --git a/install.sh b/install.sh index 89bb428a..acc56831 100755 --- a/install.sh +++ b/install.sh @@ -15,15 +15,25 @@ get_distribution() { echo "$lsb_dist" } -# Usage: +# Use command exists to test if a command is present on the system. E.g. # -# if command_exists lsb_release; then +# if command_exists lsb_release; then command_exists() { command -v "$@" > /dev/null 2>&1 } get_distribution +# Void Linux / xbps +if command_exists xbps-install; then + set -e + printf "Using xbps-install to install sq...\n\n" + + (xbps-install -Syu || true) && xbps-install -yu xbps + xbps-install -yu sq + exit +fi + # apt / deb if [ -r /etc/debian_version ] && command_exists apt; then set -e