diff --git a/dev-util/cmake/cmake-3.11.1.ebuild b/dev-util/cmake/cmake-3.11.1.ebuild index 2ceccc1ef95..121e8eb42ba 100644 --- a/dev-util/cmake/cmake-3.11.1.ebuild +++ b/dev-util/cmake/cmake-3.11.1.ebuild @@ -65,10 +65,8 @@ PATCHES=( cmake_src_bootstrap() { # Cleanup args to extract only JOBS. # Because bootstrap does not know anything else. - echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null - if [ $? -eq 0 ]; then - par_arg=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+') - par_arg="--parallel=${par_arg}" + if grep -Eq '(\-j|\-\-jobs)(=*|[[:space:]]*)[[:digit:]]+' <<< ${MAKEOPTS} : then + par_arg="--parallel=$(sed 's@.*\(-j\|--jobs\)\(=*\|[[:space:]]*\)\([[:digit:]]\+\).*@\3@' <<< ${MAKEOPTS})" else par_arg="--parallel=1" fi