Commit 8b2c3ef4 by Yuichiro NAITO

Code clean up

1. reduce redundant testing
2. handling release numbers more robust
3. discard STDOUT messages more clearly
parent 4dc6d7d7
...@@ -552,8 +552,9 @@ build_package_standard() { ...@@ -552,8 +552,9 @@ build_package_standard() {
local PACKAGE_MAKE_INSTALL_OPTS_ARRAY="${package_var_name}_MAKE_INSTALL_OPTS_ARRAY[@]" local PACKAGE_MAKE_INSTALL_OPTS_ARRAY="${package_var_name}_MAKE_INSTALL_OPTS_ARRAY[@]"
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS" local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
[ "$package_var_name" = "RUBY" ] && use_homebrew_readline || true if [ "$package_var_name" = "RUBY" ]; then
[ "$package_var_name" = "RUBY" ] && use_freebsd_pkg || true use_homebrew_readline || use_freebsd_pkg ||true
fi
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then ( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}" export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
...@@ -928,12 +929,13 @@ use_freebsd_pkg() { ...@@ -928,12 +929,13 @@ use_freebsd_pkg() {
fi fi
# check if 11-R or later # check if 11-R or later
if [ "$(uname -r | sed 's/[^[:digit:]].*//')" -ge 11 ]; then release="$(uname -r)"
if $(pkg info -e libedit); then if [ "${release%%.*}" -ge 11 ]; then
if pkg info -e libedit > /dev/null; then
# use libedit from Ports Collection # use libedit from Ports Collection
package_option ruby configure --enable-libedit package_option ruby configure --enable-libedit
package_option ruby configure --with-libedit-dir="/usr/local" package_option ruby configure --with-libedit-dir="/usr/local"
elif $(pkg info -e readline); then elif pkg info -e readline > /dev/null; then
# use readline from Ports Collection # use readline from Ports Collection
package_option ruby configure --with-readline-dir="/usr/local" package_option ruby configure --with-readline-dir="/usr/local"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment