diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
commit | c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /packaging/installer/dependencies/alpine.sh | |
parent | Adding upstream version 1.43.2. (diff) | |
download | netdata-0d980fd06561f4670f5d8170c5aedd74023e3702.tar.xz netdata-0d980fd06561f4670f5d8170c5aedd74023e3702.zip |
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/dependencies/alpine.sh')
-rwxr-xr-x | packaging/installer/dependencies/alpine.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/packaging/installer/dependencies/alpine.sh b/packaging/installer/dependencies/alpine.sh index 321d57707..ee0504b34 100755 --- a/packaging/installer/dependencies/alpine.sh +++ b/packaging/installer/dependencies/alpine.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Package tree used for installing netdata on distribution: # << Alpine: [3.12] [3.13] [3.14] [3.15] [edge] >> @@ -31,6 +31,9 @@ package_tree=" util-linux-dev libmnl-dev json-c-dev + musl-fts-dev + bison + flex yaml-dev " @@ -67,7 +70,8 @@ check_flags() { done if [ "${DONT_WAIT}" -eq 0 ] && [ "${NON_INTERACTIVE}" -eq 0 ]; then - read -r -p "Press ENTER to run it > " || exit 1 + printf "Press ENTER to run it > " + read -r || exit 1 fi } @@ -76,8 +80,18 @@ check_flags ${@} packages_to_install= +handle_old_alpine() { + version="$(grep VERSION_ID /etc/os-release | cut -f 2 -d '=')" + major="$(echo "${version}" | cut -f 1 -d '.')" + minor="$(echo "${version}" | cut -f 2 -d '.')" + + if [ "${major}" -le 3 ] && [ "${minor}" -le 16 ]; then + package_tree="$(echo "${package_tree}" | sed 's/musl-fts-dev/fts-dev/')" + fi +} + for package in $package_tree; do - if apk -e info "$package" &> /dev/null; then + if apk -e info "$package" > /dev/null 2>&1 ; then echo "Package '${package}' is installed" else echo "Package '${package}' is NOT installed" @@ -85,7 +99,7 @@ for package in $package_tree; do fi done -if [[ -z $packages_to_install ]]; then +if [ -z "${packages_to_install}" ]; then echo "All required packages are already installed. Skipping .." else echo "packages_to_install:" "$packages_to_install" |