diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:32:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 03:32:49 +0000 |
commit | 8053187731ae8e3eb368d8360989cf5fd6eed9f7 (patch) | |
tree | 32bada84ff5d7460cdf3934fcbdbe770d6afe4cd /ci/env-linux.inc.sh | |
parent | Initial commit. (diff) | |
download | rnp-8053187731ae8e3eb368d8360989cf5fd6eed9f7.tar.xz rnp-8053187731ae8e3eb368d8360989cf5fd6eed9f7.zip |
Adding upstream version 0.17.0.upstream/0.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ci/env-linux.inc.sh')
-rw-r--r-- | ci/env-linux.inc.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ci/env-linux.inc.sh b/ci/env-linux.inc.sh new file mode 100644 index 0000000..9267972 --- /dev/null +++ b/ci/env-linux.inc.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# shellcheck disable=SC1091 + +: "${CORES:=$(grep -c '^$' /proc/cpuinfo)}" +export CORES +export MAKE=make + +DIST="$(get_linux_dist)" +DIST_VERSION_ID="$(sh -c '. /etc/os-release && echo $VERSION_ID')" +DIST_VERSION="${DIST}-${DIST_VERSION_ID}" + +export DIST +export DIST_VERSION +export DIST_VERSION_ID + +case "${DIST}" in + centos|fedora) + if command -v dnf >/dev/null; then + export YUM=dnf + else + export YUM=yum + fi + export SUDO=sudo + ;; + ubuntu) + export SUDO=sudo + ;; +esac + +# XXX: debug function for locale +case "${DIST}" in + fedora|centos) + debuglocale() { + locale -a + localedef --list-archive + if ! command -v diff >/dev/null; then + "${YUM}" -y -q install diffutils + fi + bash -c 'diff -u <(localedef --list-archive | sort) <(locale -a | sort) || :' + localedef -c -i "${LC_ALL%.*}" -f UTF-8 "${LC_ALL}" + # Error: character map file `UTF-8' not found: No such file or directory + # Error: cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory + locale -a | grep "${LC_ALL}" || : + } + ;; +esac |