Skip to content

Commit 71633c8

Browse files
committed
misc-scripts: Restructure
* Split out run.sh from check-distro-clang.sh and rename to install-check-clang-version.sh. * Move both scripts and gitignore under distro-clang subfolder, in case new scripts get added in the future. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent f37af9e commit 71633c8

3 files changed

Lines changed: 28 additions & 33 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
results.log
2-
run.sh
Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,9 @@ DOCKER_DISTROS=(
2929
)
3030

3131
BASE=$(dirname "$(readlink -f "${0}")")
32-
RUN_SCRIPT=${BASE}/run.sh
33-
34-
cat <<'EOF' >"${RUN_SCRIPT}"
35-
#!/usr/bin/env bash
36-
37-
RESULTS=$(dirname "$(readlink -f "${0}")")/results.log
38-
39-
set -x
40-
41-
# Debian/Ubuntu
42-
if command -v apt-get &>/dev/null; then
43-
apt-get update
44-
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
45-
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y clang
46-
# Fedora
47-
elif command -v dnf &>/dev/null; then
48-
dnf update -y
49-
dnf install -y clang
50-
# Arch
51-
elif command -v pacman &>/dev/null; then
52-
pacman -Syyu --noconfirm
53-
pacman -S --noconfirm clang
54-
# OpenSUSE Leap/Tumbleweed
55-
elif command -v zypper &>/dev/null; then
56-
zypper -n up
57-
zypper -n in clang
58-
fi
59-
60-
echo "${1}: $(clang --version | head -n1)" >> "${RESULTS}"
61-
EOF
62-
chmod +x "${RUN_SCRIPT}"
6332

6433
rm "${BASE}"/results.log
34+
6535
for DISTRO in "${DOCKER_DISTROS[@]}"; do
6636
DISTRO=docker.io/${DISTRO}
6737
"${BINARY}" pull "${DISTRO}"
@@ -71,7 +41,7 @@ for DISTRO in "${DOCKER_DISTROS[@]}"; do
7141
--volume="${BASE}:${BASE}" \
7242
--workdir="${BASE}" \
7343
"${DISTRO}" \
74-
"${BASE}"/run.sh "${DISTRO}"
44+
"${BASE}"/install-check-clang-version.sh "${DISTRO}"
7545
done
7646

7747
echo
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
RESULTS=$(dirname "$(readlink -f "${0}")")/results.log
4+
5+
set -x
6+
7+
# Debian/Ubuntu
8+
if command -v apt-get &>/dev/null; then
9+
apt-get update
10+
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
11+
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y clang
12+
# Fedora
13+
elif command -v dnf &>/dev/null; then
14+
dnf update -y
15+
dnf install -y clang
16+
# Arch
17+
elif command -v pacman &>/dev/null; then
18+
pacman -Syyu --noconfirm
19+
pacman -S --noconfirm clang
20+
# OpenSUSE Leap/Tumbleweed
21+
elif command -v zypper &>/dev/null; then
22+
zypper -n up
23+
zypper -n in clang
24+
fi
25+
26+
echo "${1}: $(clang --version | head -n1)" >> "${RESULTS}"

0 commit comments

Comments
 (0)