diff --git a/dropshell-build/Dockerfile b/dropshell-build/Dockerfile index f6d7521..1ca6d80 100644 --- a/dropshell-build/Dockerfile +++ b/dropshell-build/Dockerfile @@ -11,7 +11,6 @@ RUN apt-get update && apt-get install -y \ COPY --chmod=0755 ./src/*.sh /usr/local/bin/ -RUN /usr/local/bin/pre_download_musl.sh RUN /usr/local/bin/install_dropshell_build_requirements.sh WORKDIR /app diff --git a/dropshell-build/src/install_dropshell_build_requirements.sh b/dropshell-build/src/install_dropshell_build_requirements.sh index 5fc7ea7..bd120ee 100755 --- a/dropshell-build/src/install_dropshell_build_requirements.sh +++ b/dropshell-build/src/install_dropshell_build_requirements.sh @@ -309,6 +309,15 @@ function install_musl() { rm -rf "$TMPDIR" } +function output_version() { + local VERSIONDATE + local CONFIG_DIR="$USER_HOME/.config/dropshell-build/" + mkdir -p "$CONFIG_DIR" + VERSIONDATE="$(date +%Y.%m%d.%H%M)" + echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version" + +} + #---------------------------------------------------------------------------------------------------------- # Main @@ -324,11 +333,7 @@ function main() { install_openssl_musl - local VERSIONDATE - local CONFIG_DIR="$USER_HOME/.config/dropshell-build/" - mkdir -p "$CONFIG_DIR" - VERSIONDATE="$(date +%Y.%m%d.%H%M)" - echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version" + output_version echo "Done" } diff --git a/dropshell-build/src/pre_download_musl.sh b/dropshell-build/src/pre_download_musl.sh deleted file mode 100644 index 691f641..0000000 --- a/dropshell-build/src/pre_download_musl.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" - -# If the user is not root, use the home directory of the user who ran the script -USER_HOME="$HOME" -if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then - USER_HOME=$(eval echo "~${SUDO_USER}") -fi - -# Set install directory -INSTALL_DIR="$USER_HOME/.musl-cross" -mkdir -p "$INSTALL_DIR" - -TMPDIR=$(mktemp -d) -trap 'rm -rf "$TMPDIR"' EXIT - - -#---------------------------------------------------------------------------------------------------------- -# Main -#---------------------------------------------------------------------------------------------------------- - -function install_musl_cross() { - local TOOLCHAIN="$1" - local MUSL_CC_URL="https://getbin.xyz" - if [ ! -d "$INSTALL_DIR/$TOOLCHAIN" ]; then - echo "Downloading $TOOLCHAIN musl cross toolchain..." - wget -nc -O "$TMPDIR/$TOOLCHAIN.tgz" "$MUSL_CC_URL/$TOOLCHAIN.tgz:latest" - tar -C "$INSTALL_DIR" -xvf "$TMPDIR/$TOOLCHAIN.tgz" - fi -} - -function predownload() { - TOOLCHAIN_LIST=( - "aarch64-linux-musl-cross" - "x86_64-linux-musl-cross" - ) - - for TOOLCHAIN in "${TOOLCHAIN_LIST[@]}"; do - install_musl_cross "$TOOLCHAIN" - done -} - -predownload \ No newline at end of file