From 4dbada1e0e903725c5d10d19a356527a3fb5a964 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Tue, 14 Mar 2023 15:22:49 +0100 Subject: Add Alpine support --- lib/util/pkg.bash | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/util/pkg.bash') diff --git a/lib/util/pkg.bash b/lib/util/pkg.bash index 1538c3e..1433815 100644 --- a/lib/util/pkg.bash +++ b/lib/util/pkg.bash @@ -33,10 +33,11 @@ pkg_install() { local app=$1 ; shift case "${BASHTARD_PLATFORM[key]}" in - freebsd) set -- /usr/sbin/pkg install -y "$app" ;; - linux-debian*) set -- apt install -y "$app" ;; - linux-gentoo) set -- emerge --ask=n --update "$app" ;; - linux-ubuntu) set -- apt install -y "$app" ;; + freebsd) set -- /usr/sbin/pkg install -y "$app" ;; + linux-alpine_linux) set -- apk add --no-cache "$app" ;; + linux-debian*) set -- apt install -y "$app" ;; + linux-gentoo) set -- emerge --ask=n --update "$app" ;; + linux-ubuntu) set -- apt install -y "$app" ;; *) crit "$system" "No package manager configured for ${BASHTARD_PLATFORM[key]}" return 1 @@ -54,10 +55,11 @@ pkg_uninstall() { local app=$1 ; shift case "${BASHTARD_PLATFORM[key]}" in - freebsd) set -- /usr/sbin/pkg uninstall -y "$app" ;; - linux-debian*) set -- apt remove -y "$app" ;; - linux-gentoo) set -- emerge --ask=n --unmerge "$app" ;; - linux-ubuntu) set -- apt remove -y "$app" ;; + freebsd) set -- /usr/sbin/pkg uninstall -y "$app" ;; + linux-alpine_linux) set -- apk del "$app" ;; + linux-debian*) set -- apt remove -y "$app" ;; + linux-gentoo) set -- emerge --ask=n --unmerge "$app" ;; + linux-ubuntu) set -- apt remove -y "$app" ;; *) crit "$system" "No package manager configured for ${BASHTARD_PLATFORM[key]}" return 1 -- cgit v1.1