This is an automated email from the ASF dual-hosted git repository.
jonkeane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 40571db03c MINOR: [R] Avoid stray output from expr when checking for
10.13 (#38303)
40571db03c is described below
commit 40571db03cc7f819f33a05dd421ef86816fe0502
Author: Jacob Wujciak-Jens <[email protected]>
AuthorDate: Tue Oct 17 17:22:18 2023 +0200
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 <[email protected]>
Co-authored-by: Jonathan Keane <[email protected]>
Signed-off-by: Jonathan Keane <[email protected]>
---
r/configure | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/r/configure b/r/configure
index addf7b59c7..c957c9946f 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