From f1126d07fc572d52bc477e87798212a55783de84 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Mon, 6 Mar 2023 23:21:14 +0900 Subject: [PATCH] Updated building/packaging scripts --- .github/workflows/phpext_helper.sh | 24 +++++++++++++----------- buildutils/php_debian_build.sh | 24 +++++++++++++----------- buildutils/php_rpm_build.sh | 24 +++++++++++++----------- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/.github/workflows/phpext_helper.sh b/.github/workflows/phpext_helper.sh index 870ac5c..c9a12c5 100755 --- a/.github/workflows/phpext_helper.sh +++ b/.github/workflows/phpext_helper.sh @@ -19,7 +19,7 @@ # # AUTHOR: Takeshi Nakatani # CREATE: Fri, Feb 24 2022 -# REVISION: +# REVISION: 1.1 # #============================================================== @@ -33,16 +33,18 @@ PIPEFAILURE_FILE="/tmp/.pipefailure.$(od -An -tu4 -N4 /dev/random | tr -d ' \n') # # For shellcheck # -if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL -elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL +if command -v locale >/dev/null 2>&1; then + if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + fi fi #============================================================== diff --git a/buildutils/php_debian_build.sh b/buildutils/php_debian_build.sh index d6d219e..db6ebb3 100755 --- a/buildutils/php_debian_build.sh +++ b/buildutils/php_debian_build.sh @@ -19,7 +19,7 @@ # # AUTHOR: Takeshi Nakatani # CREATE: Tue, Feb 22 2022 -# REVISION: +# REVISION: 1.1 # #============================================================== @@ -33,16 +33,18 @@ PIPEFAILURE_FILE="/tmp/.pipefailure.$(od -An -tu4 -N4 /dev/random | tr -d ' \n') # # For shellcheck # -if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL -elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL +if command -v locale >/dev/null 2>&1; then + if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + fi fi #---------------------------------------------------------- diff --git a/buildutils/php_rpm_build.sh b/buildutils/php_rpm_build.sh index ea9c7fd..c14a56a 100755 --- a/buildutils/php_rpm_build.sh +++ b/buildutils/php_rpm_build.sh @@ -19,7 +19,7 @@ # # AUTHOR: Takeshi Nakatani # CREATE: Fri, Feb 18 2022 -# REVISION: +# REVISION: 1.1 # #============================================================== @@ -33,16 +33,18 @@ # # For shellcheck # -if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL -elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then - LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') - LC_ALL="${LANG}" - export LANG - export LC_ALL +if command -v locale >/dev/null 2>&1; then + if locale -a | grep -q -i '^[[:space:]]*C.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*C.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + elif locale -a | grep -q -i '^[[:space:]]*en_US.utf8[[:space:]]*$'; then + LANG=$(locale -a | grep -i '^[[:space:]]*en_US.utf8[[:space:]]*$' | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*$//g' | tr -d '\n') + LC_ALL="${LANG}" + export LANG + export LC_ALL + fi fi #----------------------------------------------------------