From 48a4a038bcee3cdee15bc55bbb41a0eab5fc4a83 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Thu, 23 Jul 2026 09:38:05 +0900 Subject: [PATCH 1/4] GH-50609: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_deps.sh --- .pre-commit-config.yaml | 1 + ci/scripts/r_deps.sh | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa02e1c8e34d..d48cb3c18ca4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -338,6 +338,7 @@ repos: ?^ci/scripts/python_wheel_macos_build\.sh$| ?^ci/scripts/python_wheel_xlinux_build\.sh$| ?^ci/scripts/r_build\.sh$| + ?^ci/scripts/r_deps\.sh$| ?^ci/scripts/r_revdepcheck\.sh$| ?^ci/scripts/release_test\.sh$| ?^ci/scripts/ruby_test\.sh$| diff --git a/ci/scripts/r_deps.sh b/ci/scripts/r_deps.sh index 2b432f768c2b..5f29de19e6c9 100755 --- a/ci/scripts/r_deps.sh +++ b/ci/scripts/r_deps.sh @@ -18,21 +18,21 @@ set -ex -: ${R_BIN:=R} +: "${R_BIN:=R}" -: ${R_PRUNE_DEPS:=FALSE} -R_PRUNE_DEPS=`echo $R_PRUNE_DEPS | tr '[:upper:]' '[:lower:]'` +: "${R_PRUNE_DEPS:=FALSE}" +R_PRUNE_DEPS=$(echo "$R_PRUNE_DEPS" | tr '[:upper:]' '[:lower:]') -: ${R_DUCKDB_DEV:=FALSE} -R_DUCKDB_DEV=`echo $R_DUCKDB_DEV | tr '[:upper:]' '[:lower:]'` +: "${R_DUCKDB_DEV:=FALSE}" +R_DUCKDB_DEV=$(echo "$R_DUCKDB_DEV" | tr '[:upper:]' '[:lower:]') -source_dir=${1}/r +source_dir="${1}/r" -pushd ${source_dir} +pushd "${source_dir}" -if [ ${R_PRUNE_DEPS} = "true" ]; then +if [ "${R_PRUNE_DEPS}" = "true" ]; then # To prevent the build from timing out, let's prune some optional deps (and their possible version requirements) - ${R_BIN} -e 'd <- read.dcf("DESCRIPTION") + "${R_BIN}" -e 'd <- read.dcf("DESCRIPTION") to_prune <- c("duckdb", "DBI", "dbplyr", "decor", "knitr", "rmarkdown", "pkgload", "reticulate") pattern <- paste0("\\n?", to_prune, " (\\\\(.*\\\\))?,?", collapse = "|") d[,"Suggests"] <- gsub(pattern, "", d[,"Suggests"]) @@ -43,15 +43,15 @@ fi # install.packages() emits warnings if packages fail to install, # but we want to error/fail the build. # options(warn=2) turns warnings into errors -${R_BIN} -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '"${INSTALL_ARGS}"')" +"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '""${INSTALL_ARGS}""')" # Install DuckDB from github when requested -if [ ${R_DUCKDB_DEV} == "true" ]; then - ${R_BIN} -e "remotes::install_github('duckdb/duckdb-r', build = FALSE)" +if [ "${R_DUCKDB_DEV}" == "true" ]; then + "${R_BIN}" -e "remotes::install_github('duckdb/duckdb-r', build = FALSE)" fi # Separately install the optional/test dependencies but don't error on them, # they're not available everywhere and that's ok -${R_BIN} -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '"${INSTALL_ARGS}"')" +"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '""${INSTALL_ARGS}""')" popd From bf255317a0aa870a23057200cf4abc84c56ecc23 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Thu, 23 Jul 2026 12:55:36 +0900 Subject: [PATCH 2/4] Update ci/scripts/r_deps.sh Co-authored-by: Sutou Kouhei --- ci/scripts/r_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/r_deps.sh b/ci/scripts/r_deps.sh index 5f29de19e6c9..dfa13a0f8189 100755 --- a/ci/scripts/r_deps.sh +++ b/ci/scripts/r_deps.sh @@ -43,7 +43,7 @@ fi # install.packages() emits warnings if packages fail to install, # but we want to error/fail the build. # options(warn=2) turns warnings into errors -"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '""${INSTALL_ARGS}""')" +"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '\"${INSTALL_ARGS}\"')" # Install DuckDB from github when requested if [ "${R_DUCKDB_DEV}" == "true" ]; then From f452e8fc7cf6be061cb719433ce43865aa1f7763 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Thu, 23 Jul 2026 12:57:58 +0900 Subject: [PATCH 3/4] GH-50609: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_deps.sh --- ci/scripts/r_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/r_deps.sh b/ci/scripts/r_deps.sh index dfa13a0f8189..f1ea5c0e9afe 100755 --- a/ci/scripts/r_deps.sh +++ b/ci/scripts/r_deps.sh @@ -52,6 +52,6 @@ fi # Separately install the optional/test dependencies but don't error on them, # they're not available everywhere and that's ok -"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '""${INSTALL_ARGS}""')" +"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '\"${INSTALL_ARGS}\"')" popd From 85f2b3ee56539e6ed2a8b8b286207a1fd67667df Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Thu, 23 Jul 2026 13:46:47 +0900 Subject: [PATCH 4/4] GH-50609: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_deps.sh --- ci/scripts/r_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/r_deps.sh b/ci/scripts/r_deps.sh index f1ea5c0e9afe..94f72ce78e60 100755 --- a/ci/scripts/r_deps.sh +++ b/ci/scripts/r_deps.sh @@ -43,7 +43,7 @@ fi # install.packages() emits warnings if packages fail to install, # but we want to error/fail the build. # options(warn=2) turns warnings into errors -"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '\"${INSTALL_ARGS}\"')" +"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '${INSTALL_ARGS}')" # Install DuckDB from github when requested if [ "${R_DUCKDB_DEV}" == "true" ]; then @@ -52,6 +52,6 @@ fi # Separately install the optional/test dependencies but don't error on them, # they're not available everywhere and that's ok -"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '\"${INSTALL_ARGS}\"')" +"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '${INSTALL_ARGS}')" popd