Skip to content

Commit

Permalink
Check for glibc version instead of distro version (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
wknapik authored Nov 4, 2024
1 parent 2890726 commit e350e6d
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 410 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: "shellcheck install.sh"
- run: "make shellcheck"
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
unsupported := alpine voidlinux/voidlinux-musl ubuntu_16.04 debian_9 linuxmintd/mint18-amd64 fedora_26 opensuse/leap_42.3
supported := ubuntu_18.04 debian_10 linuxmintd/mint19-amd64 fedora_28 opensuse/leap_15 opensuse/tumbleweed rockylinux_9 manjarolinux/base # fedora_27 hangs
distros := $(unsupported) $(supported)

test: $(distros)

MAKEFLAGS := -rRO
SHELL := $(shell command -v bash)
.SHELLFLAGS := -eEo pipefail -c
.ONESHELL:
$(V).SILENT:
.PHONY: clean shellcheck test $(distros) $(distros:%=%_clean)

$(distros): distro = $(subst _,:,$@)
$(distros) $(distros:%=%_clean): log = $(subst /,_,$(subst _,:,$(@:%_clean=%))).log

$(unsupported):
echo -n "Testing $(distro) (unsupported)... "
if ! docker run --rm -v "$$PWD/install.sh:/install.sh" "$(distro)" /install.sh >"$(log)" 2>&1 &&\
grep -q "Unsupported glibc version" "$(log)"; then
echo OK
else
printf "Failed\n\n" && tail -v "$(log)" && false
fi

opensuse/tumbleweed: setup = zypper --non-interactive install libglib-2_0-0

$(supported):
echo -n "Testing $(distro) (supported)... "
if docker run --rm -v "$$PWD/install.sh:/install.sh" "$(distro)" \
sh -c '$(or $(setup),true) && /install.sh && brave-browser --version || brave --version' >"$(log)" 2>&1; then
echo OK
else
printf "Failed\n\n" && tail -v "$(log)" && false
fi

shellcheck:
shellcheck -e SC2086 install.sh

clean: $(distros:%=%_clean)

$(distros:%=%_clean):
rm -f "$(log)"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Script to detect the OS version and install the recommend version of Brave.
Script to install the Brave browser.

It is designed to be piped directly into `sh`.

Expand Down
Loading

0 comments on commit e350e6d

Please sign in to comment.