aboutsummaryrefslogtreecommitdiff
path: root/lib/util/pkg.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-03-14 15:22:49 +0100
committerPatrick Spek <p.spek@tyil.nl>2023-03-14 15:22:49 +0100
commit4dbada1e0e903725c5d10d19a356527a3fb5a964 (patch)
treedd973ba54deb276ab4b867eaf8fb6b0527e3ca82 /lib/util/pkg.bash
parent872d6ff1e929e67fdf9d0ed529596ef33842f9fb (diff)
Add Alpine support
Diffstat (limited to 'lib/util/pkg.bash')
-rw-r--r--lib/util/pkg.bash18
1 files changed, 10 insertions, 8 deletions
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