Skip to content

Commit a993afa

Browse files
committed
Extract package check out of the rust bin condition
1 parent c780149 commit a993afa

File tree

1 file changed

+8
-12
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-code-server-rust-install

1 file changed

+8
-12
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-code-server-rust-install/run

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ if [[ ! " ${SUPPORTED_ARCHS[@]} " =~ " ${ARCH} " ]]; then
1313
exit 1
1414
fi
1515

16-
RUST_BINARY_ARCHIVE_PATH="$RUST_BINS_PATH/rust-$ARCH-gnu.tar.gz"
16+
if ! dpkg -l | grep build-essential >/dev/null; then
17+
echo "**** adding build-essential to install list ****"
18+
echo "build-essential" >>"$PACKAGES_TO_INSTALL_LIST"
19+
else
20+
echo "**** build-essential already installed ****"
21+
fi
1722

18-
grep_os_release() {
19-
grep -q "$1" /etc/os-release && true || false
20-
}
23+
RUST_BINARY_ARCHIVE_PATH="$RUST_BINS_PATH/rust-$ARCH-gnu.tar.gz"
2124

2225
if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
2326
echo "**** unpacking rust tar ****"
@@ -26,13 +29,6 @@ if [[ -f "$RUST_BINARY_ARCHIVE_PATH" ]]; then
2629
echo "**** installing rust ****"
2730
"$RUST_BINS_PATH/install.sh"
2831
rm -rf "$RUST_BINS_PATH"
29-
30-
echo "**** adding build tools ****"
31-
if grep_os_release "debian"; then
32-
echo "build-essential" >>"$PACKAGES_TO_INSTALL_LIST"
33-
else
34-
echo "gcc" >>"$PACKAGES_TO_INSTALL_LIST"
35-
fi
3632
else
37-
echo "**** rust already installed ****"
33+
echo "**** rust bin does not exist ****"
3834
fi

0 commit comments

Comments
 (0)