8000 distro-clang: Style changes · ClangBuiltLinux/misc-scripts@27d85bd · GitHub
[go: up one dir, main page]

Skip to content

Commit 27d85bd

Browse files
committed
distro-clang: Style changes
* Lowercase local variables * Remove braces * Make certain variables less descriptive Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent 114ceef commit 27d85bd

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

distro-clang/get-distro-clang.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
trap 'exit' INT
44

55
# Make sure we have the required binaries
6-
for NAME in podman docker; do
7-
command -v "${NAME}" &>/dev/null && BINARY=${NAME}
6+
for name in podman docker; do
7+
command -v "$name" &>/dev/null && binary=$name
88
done
9-
if [[ -z ${BINARY} ]]; then
9+
if [[ -z $binary ]]; then
1010
echo "Neither podman nor docker could be found on your system! Please install one to use this script."
1111
exit 1
1212
fi
@@ -37,7 +37,7 @@ fi
3737
# Tags such as "latest", "stable", or "rolling" are preferred so that the list
3838
# does not have to be constantly updated. Old but supported releases like
3939
# Fedora or OpenSUSE are the exception.
40-
DOCKER_DISTROS=(
40+
distros=(
4141
archlinux:latest
4242

4343
debian:oldoldstable-slim
@@ -61,21 +61,22 @@ DOCKER_DISTROS=(
6161
ubuntu:devel
6262
)
6363

64-
BASE=$(dirname "$(readlink -f "${0}")")
64+
base=$(dirname "$(readlink -f "$0")"< 10000 /span>)
65+
results=$base/results.log
6566

66-
rm "${BASE}"/results.log
67+
rm "$results"
6768

68-
for DISTRO in "${DOCKER_DISTROS[@]}"; do
69-
DISTRO=docker.io/${DISTRO}
70-
"${BINARY}" pull "${DISTRO}"
71-
"${BINARY}" run \
69+
for distro in "${distros[@]}"; do
70+
distro=docker.io/$distro
71+
"$binary" pull "$distro"
72+
"$binary" run \
7273
--rm \
7374
--init \
74-
--volume="${BASE}:${BASE}" \
75-
--workdir="${BASE}" \
76-
"${DISTRO}" \
77-
"${BASE}"/install-check-clang-version.sh "${DISTRO}"
75+
--volume="$base:$base" \
76+
--workdir="$base" \
77+
"$distro" \
78+
"$base"/install-check-clang-version.sh "$distro"
7879
done
7980

8081
echo
81-
cat "${BASE}"/results.log
82+
cat "$results"

distro-clang/install-check-clang-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
RESULTS=$(dirname "$(readlink -f "${0}")")/results.log
3+
results=$(dirname "$(readlink -f "${0}")")/results.log
44

55
set -x
66

@@ -23,4 +23,4 @@ elif command -v zypper &>/dev/null; then
2323
zypper -n in clang
2424
fi
2525

26-
echo "${1}: $(clang --version | head -n1)" >> "${RESULTS}"
26+
echo "$1: $(clang --version | head -n1)" >> "$results"

0 commit comments

Comments
 (0)
0