Skip to content

Commit 5345346

Browse files
committed
chore(base): add install stack log
1 parent 51f42a4 commit 5345346

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

debootstrap/bookworm/rootfs/usr/bin/install-stack

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function main() {
2626
local os_arch="${OS_ARCH:-$(dpkg --print-architecture)}"
2727
local os_flavour="${OS_FLAVOUR:-${ID}-${VERSION_ID}}"
2828

29+
local stack_path="/opt/drycc/${name}"
2930
local stack_name="${name}-${version}-${os_name}-${os_arch}-${os_flavour}"
3031
local stack_filename="${stack_name}".tar.gz
3132
local stack_download_url="${STACK_DOWNLOAD_URL}/${name}/${stack_filename}"
@@ -38,18 +39,23 @@ function main() {
3839
else
3940
curl --silent --show-error --fail "${stack_download_url}" -o "${TMP_DIR}/${stack_filename}"
4041
fi
41-
echo "Generate installation directory: /opt/drycc/${name}"
42-
if [ -d /opt/drycc/"${name}" ]; then
43-
rm -rf /opt/drycc/"${name}"
42+
echo "Generate installation directory: ${stack_path}"
43+
if [ -d "${stack_path}" ]; then
44+
echo "Clean up the directory: ${stack_path}"
45+
rm -rf "${stack_path}"
4446
fi
45-
mkdir -p /opt/drycc/"${name}"
46-
47+
mkdir -p "${stack_path}"
48+
49+
echo "Extract data to a temporary directory: ${TMP_DIR}"
4750
tar --directory "${TMP_DIR}" --extract --gunzip --file "${TMP_DIR}"/"${stack_filename}" --no-same-owner
51+
52+
echo "Install stack to directory: ${stack_path}"
4853
# shellcheck disable=SC2046,SC2086
4954
install-packages $(< "${TMP_DIR}"/meta/dependencies)
5055
"${TMP_DIR}"/meta/preinstall
51-
cp -rf "${TMP_DIR}"/data/* /opt/drycc/"${name}"
56+
cp -rf "${TMP_DIR}"/data/* "${stack_path}"
5257
"${TMP_DIR}"/meta/postinstall
58+
echo "Stack installation completed"
5359
}
5460

5561
main "$@"

0 commit comments

Comments
 (0)