From a4c83d2b549841d77beae167fe47893168129506 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 15 Dec 2025 18:18:42 -0600 Subject: [PATCH] Update: Use regular grep rather than POSIX regex grep in package.sh build script. Not every version of grep supports POSIX regex. Use the uglier but better supported equivalent match strings to make the package script more portable. --- build/scripts/package.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/scripts/package.sh b/build/scripts/package.sh index c6ccb33..3f042d0 100644 --- a/build/scripts/package.sh +++ b/build/scripts/package.sh @@ -1503,16 +1503,16 @@ package_operation_create_config_stubs() { local language= - if [[ $(grep -shoP '^\s*\bbuild_language\b\s+c\s*$' ${package}data/build/settings) != "" ]] ; then + if [[ $(grep -sho '^[[:space:]]*\[[:space:]]\+c[[:space:]]*$' ${package}data/build/settings) != "" ]] ; then language="c" - elif [[ $(grep -shoP '^\s*\bbuild_language\b\s+c\+\+\s*$' ${package}data/build/settings) != "" ]] ; then + elif [[ $(grep -sho '^[[:space:]]*\[[:space:]]\+c++[[:space:]]*$' ${package}data/build/settings) != "" ]] ; then language="c++" else return 0 fi if [[ ${language} == "c" && ! -f ${package}sources/c/config.c ]] ; then - if [[ $(grep -shoP '^\s*\bbuild_sources_program\b\s+\S' ${package}data/build/settings) != "" || $(grep -shoP '^\s*\bbuild_sources_library\b\s+\S' ${package}data/build/settings) != "" ]] ; then + if [[ $(grep -sho '^[[:space:]]*\[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" || $(grep -sho '^[[:space:]]*\[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" ]] ; then echo > ${package}sources/c/config.c && echo "#include \"config.h\"" >> ${package}sources/c/config.c @@ -1527,7 +1527,7 @@ package_operation_create_config_stubs() { fi fi elif [[ ${language} == "c++" && ! -f ${package}sources/c/config.cpp ]] ; then - if [[ $(grep -shoP '^\s*\bbuild_sources_program\b\s+\S' ${package}data/build/settings) != "" || $(grep -shoP '^\s*\bbuild_sources_library\b\s+\S' ${package}data/build/settings) != "" ]] ; then + if [[ $(grep -sho '^[[:space:]]*\[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" || $(grep -sho '^[[:space:]]*\[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" ]] ; then echo > ${package}sources/c++/config.cpp && echo "#include \"config.h\"" >> ${package}sources/c++/config.cpp @@ -1544,7 +1544,7 @@ package_operation_create_config_stubs() { fi if [[ ( ${language} == "c" && ! -f ${package}sources/c/config.h ) || ( ${language} == "c++" && ! -f ${package}sources/c++/config.h ) ]] ; then - if [[ $(grep -shoP '^\s*\bbuild_language\b\s+c\s*$' ${package}data/build/settings) != "" ]] ; then + if [[ $(grep -sho '^[[:space:]]*\[[:space:]]\+c[[:space:]]*$' ${package}data/build/settings) != "" ]] ; then echo > ${package}sources/c/config.h if [[ ${?} -ne 0 ]] ; then @@ -2333,7 +2333,7 @@ package_operation_stand_alone() { fi if [[ -f ${package}data/build/dependencies ]] ; then - packages=$(grep -shoP '^\s*[^\s]+' ${package}data/build/dependencies* | sed -e 's|^[[:space:]]*||g') + packages=$(grep -sho '^[[:space:]]*[^[:space:]]\+' ${package}data/build/dependencies* | sed -e 's|^[[:space:]]*||g') if [[ ${packages} != "" ]] ; then for package_sub in ${packages} ; do -- 1.8.3.1