This is an automated email from the ASF dual-hosted git repository.
kou 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 8a2ff7c515 GH-46490: [CI][Dev] Add shellcheck
ci/scripts/install_ccache.sh (#46492)
8a2ff7c515 is described below
commit 8a2ff7c5156596f53beeeb2f0d767128c90de595
Author: Hiroyuki Sato <[email protected]>
AuthorDate: Mon May 19 09:32:16 2025 +0900
GH-46490: [CI][Dev] Add shellcheck ci/scripts/install_ccache.sh (#46492)
### Rationale for this change
shellcheck outputs the following error in `ci/scripts/install_ccache.sh`.
```
In ci/scripts/install_ccache.sh line 35:
curl --fail --location --remote-name ${url}
^----^ SC2086 (info): Double quote
to prevent globbing and word splitting.
Did you mean:
curl --fail --location --remote-name "${url}"
In ci/scripts/install_ccache.sh line 36:
unzip -j ccache-${version}-windows-x86_64.zip
^--------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
unzip -j ccache-"${version}"-windows-x86_64.zip
In ci/scripts/install_ccache.sh line 38:
mv ccache.exe ${prefix}/bin/
^-------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
Did you mean:
mv ccache.exe "${prefix}"/bin/
In ci/scripts/install_ccache.sh line 44:
wget -q ${url} -O - | tar -xzf - --directory /tmp/ccache
--strip-components=1
^----^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
wget -q "${url}" -O - | tar -xzf - --directory /tmp/ccache
--strip-components=1
```
### What changes are included in this PR?
Fix shellcheck error. (Quote variables)
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: #46490
Authored-by: Hiroyuki Sato <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.pre-commit-config.yaml | 1 +
ci/scripts/install_ccache.sh | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0622c80321..a1b8e9efd7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -197,6 +197,7 @@ repos:
?^ci/scripts/conan_setup\.sh$|
?^ci/scripts/download_tz_database\.sh$|
?^ci/scripts/install_azurite\.sh$|
+ ?^ci/scripts/install_ccache\.sh$|
?^ci/scripts/install_ceph\.sh$|
?^ci/scripts/install_spark\.sh$|
?^ci/scripts/integration_dask\.sh$|
diff --git a/ci/scripts/install_ccache.sh b/ci/scripts/install_ccache.sh
index 7d39e18ebe..75ca81076d 100755
--- a/ci/scripts/install_ccache.sh
+++ b/ci/scripts/install_ccache.sh
@@ -32,23 +32,23 @@ case $(uname) in
MINGW64*)
url="https://github.com/ccache/ccache/releases/download/v${version}/ccache-${version}-windows-x86_64.zip"
pushd /tmp/ccache
- curl --fail --location --remote-name ${url}
- unzip -j ccache-${version}-windows-x86_64.zip
+ curl --fail --location --remote-name "${url}"
+ unzip -j "ccache-${version}-windows-x86_64.zip"
chmod +x ccache.exe
- mv ccache.exe ${prefix}/bin/
+ mv ccache.exe "${prefix}/bin/"
popd
;;
*)
url="https://github.com/ccache/ccache/archive/v${version}.tar.gz"
- wget -q ${url} -O - | tar -xzf - --directory /tmp/ccache
--strip-components=1
+ wget -q "${url}" -O - | tar -xzf - --directory /tmp/ccache
--strip-components=1
mkdir /tmp/ccache/build
pushd /tmp/ccache/build
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=${prefix} \
+ -DCMAKE_INSTALL_PREFIX="${prefix}" \
-DZSTD_FROM_INTERNET=ON \
..
ninja install