From 3f94d9433b59276371769c2fde83cbedb186ae96 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Sun, 2 Aug 2026 22:06:30 +0900 Subject: [PATCH 1/2] GH-50766: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_docker_configure.sh --- .pre-commit-config.yaml | 1 + ci/scripts/r_docker_configure.sh | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38901778ae45..e57bd2be583c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -340,6 +340,7 @@ repos: ?^ci/scripts/python_wheel_xlinux_build\.sh$| ?^ci/scripts/r_build\.sh$| ?^ci/scripts/r_deps\.sh$| + ?^ci/scripts/r_docker_configure\.sh$| ?^ci/scripts/r_revdepcheck\.sh$| ?^ci/scripts/release_test\.sh$| ?^ci/scripts/ruby_test\.sh$| diff --git a/ci/scripts/r_docker_configure.sh b/ci/scripts/r_docker_configure.sh index ddeb2acc3b7a..21b37453f67b 100755 --- a/ci/scripts/r_docker_configure.sh +++ b/ci/scripts/r_docker_configure.sh @@ -18,28 +18,28 @@ set -ex -: ${R_BIN:=R} +: "${R_BIN:=R}" # This is where our docker setup puts things; set this to run outside of docker -: ${ARROW_SOURCE_HOME:=/arrow} +: "${ARROW_SOURCE_HOME:=/arrow}" # The Dockerfile should have put this file here if [ -f "${ARROW_SOURCE_HOME}/ci/etc/rprofile" ]; then # Ensure parallel R package installation, set CRAN repo mirror, # and use pre-built binaries where possible - cat ${ARROW_SOURCE_HOME}/ci/etc/rprofile >> $(${R_BIN} RHOME)/etc/Rprofile.site + cat "${ARROW_SOURCE_HOME}/ci/etc/rprofile" >> "$(${R_BIN} RHOME)/etc/Rprofile.site" fi # Ensure parallel compilation of C/C++ code -echo "MAKEFLAGS=-j$(${R_BIN} -s -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Renviron.site +echo "MAKEFLAGS=-j$(${R_BIN} -s -e 'cat(parallel::detectCores())')" >> "$(R RHOME)/etc/Renviron.site" # Figure out what package manager we have -if [ "`which dnf`" ]; then +if [ "$(which dnf)" ]; then PACKAGE_MANAGER=dnf -elif [ "`which yum`" ]; then +elif [ "$(which yum)" ]; then PACKAGE_MANAGER=yum -elif [ "`which zypper`" ]; then +elif [ "$(which zypper)" ]; then PACKAGE_MANAGER=zypper -elif [ "`which apk`" ]; then +elif [ "$(which apk)" ]; then PACKAGE_MANAGER=apk else PACKAGE_MANAGER=apt-get @@ -47,9 +47,9 @@ else fi # Enable ccache if requested based on http://dirk.eddelbuettel.com/blog/2017/11/27/ -: ${R_CUSTOM_CCACHE:=FALSE} -R_CUSTOM_CCACHE=`echo $R_CUSTOM_CCACHE | tr '[:upper:]' '[:lower:]'` -if [ ${R_CUSTOM_CCACHE} = "true" ]; then +: "${R_CUSTOM_CCACHE:=FALSE}" +R_CUSTOM_CCACHE=$(echo "$R_CUSTOM_CCACHE" | tr '[:upper:]' '[:lower:]') +if [ "${R_CUSTOM_CCACHE}" = "true" ]; then # install ccache if [ "$PACKAGE_MANAGER" = "apk" ]; then $PACKAGE_MANAGER add ccache @@ -80,9 +80,9 @@ fi # Install rsync for bundling cpp source and curl to make sure it is installed on all images, # cmake is now a listed sys req. if [ "$PACKAGE_MANAGER" = "apk" ]; then - $PACKAGE_MANAGER add rsync cmake curl + "$PACKAGE_MANAGER" add rsync cmake curl else - $PACKAGE_MANAGER install -y rsync cmake curl + "$PACKAGE_MANAGER" install -y rsync cmake curl fi From 5556284a21a58294cc1e3f1647763c32b2a72133 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 3 Aug 2026 11:52:21 +0900 Subject: [PATCH 2/2] GH-50766: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_docker_configure.sh --- ci/scripts/r_docker_configure.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/scripts/r_docker_configure.sh b/ci/scripts/r_docker_configure.sh index 21b37453f67b..1668b130493c 100755 --- a/ci/scripts/r_docker_configure.sh +++ b/ci/scripts/r_docker_configure.sh @@ -52,10 +52,10 @@ R_CUSTOM_CCACHE=$(echo "$R_CUSTOM_CCACHE" | tr '[:upper:]' '[:lower:]') if [ "${R_CUSTOM_CCACHE}" = "true" ]; then # install ccache if [ "$PACKAGE_MANAGER" = "apk" ]; then - $PACKAGE_MANAGER add ccache + "$PACKAGE_MANAGER" add ccache else - $PACKAGE_MANAGER install -y epel-release || true - $PACKAGE_MANAGER install -y ccache + "$PACKAGE_MANAGER" install -y epel-release || true + "$PACKAGE_MANAGER" install -y ccache fi mkdir -p ~/.R