local language=
- if [[ $(grep -shoP '^\s*\bbuild_language\b\s+c\s*$' ${package}data/build/settings) != "" ]] ; then
+ if [[ $(grep -sho '^[[:space:]]*\<build_language\>[[: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:]]*\<build_language\>[[: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:]]*\<build_sources_program\>[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" || $(grep -sho '^[[:space:]]*\<build_sources_library\>[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" ]] ; then
echo > ${package}sources/c/config.c &&
echo "#include \"config.h\"" >> ${package}sources/c/config.c
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:]]*\<build_sources_program\>[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" || $(grep -sho '^[[:space:]]*\<build_sources_library\>[[:space:]]\+[^[:space:]]' ${package}data/build/settings) != "" ]] ; then
echo > ${package}sources/c++/config.cpp &&
echo "#include \"config.h\"" >> ${package}sources/c++/config.cpp
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:]]*\<build_language\>[[:space:]]\+c[[:space:]]*$' ${package}data/build/settings) != "" ]] ; then
echo > ${package}sources/c/config.h
if [[ ${?} -ne 0 ]] ; then
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