From 40571db03cc7f819f33a05dd421ef86816fe0502 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 17 Oct 2023 17:22:18 +0200 Subject: [PATCH] MINOR: [R] Avoid stray output from expr when checking for 10.13 (#38303) ### Rationale for this change `expr` was printing the number of matching chars which showed up as noise in the log (which we want to avoid as much as possible to avoid any false positive checks) See https://github.com/apache/arrow/pull/38236#issuecomment-1761679457 for @ jonkeane's investigation. ### What changes are included in this PR? Replace use of expr with test. ### Are these changes tested? Crossbow Lead-authored-by: Jacob Wujciak-Jens Co-authored-by: Jonathan Keane Signed-off-by: Jonathan Keane --- r/configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/r/configure b/r/configure index addf7b59c7fbf..c957c9946fba0 100755 --- a/r/configure +++ b/r/configure @@ -264,7 +264,10 @@ set_pkg_vars () { PKG_CFLAGS="$PKG_CFLAGS $ARROW_R_CXXFLAGS" fi - if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13'; then + # We use expr because the product version returns more than just 10.13 and we want to + # match the substring. However, expr always outputs the number of matched characters + # to stdout, to avoid noise in the log we redirect the output to /dev/null + if [ "$UNAME" = "Darwin" ] && expr $(sw_vers -productVersion) : '10\.13' >/dev/null 2>&1; then # avoid C++17 availability warnings on macOS < 11 PKG_CFLAGS="$PKG_CFLAGS -D_LIBCPP_DISABLE_AVAILABILITY" fi