From 0e6779fafc05e397094750d68e26a36db665c151 Mon Sep 17 00:00:00 2001 From: clsty Date: Sun, 19 Oct 2025 06:59:33 +0800 Subject: [PATCH] Fixes for install scripts --- sdata/lib/environment-variables.sh | 4 ++++ sdata/lib/functions.sh | 8 ++------ sdata/lib/options-install.sh | 2 +- sdata/lib/options.sh | 2 -- sdata/lib/package-installers.sh | 4 ---- sdist/arch/install-deps.sh | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sdata/lib/environment-variables.sh b/sdata/lib/environment-variables.sh index c3c51ccee..0fb50b719 100644 --- a/sdata/lib/environment-variables.sh +++ b/sdata/lib/environment-variables.sh @@ -21,3 +21,7 @@ STY_UNDERLINE='\e[4m' STY_BLINK='\e[5m' STY_INVERT='\e[7m' STY_RST='\e[00m' + + +# Used by register_temp_file() +declare -a TEMP_FILES_TO_CLEANUP=() diff --git a/sdata/lib/functions.sh b/sdata/lib/functions.sh index dbcf7e8d2..496397f83 100644 --- a/sdata/lib/functions.sh +++ b/sdata/lib/functions.sh @@ -3,10 +3,6 @@ # shellcheck shell=bash -# The script that use this file should have two lines on its top as follows: -# cd "$(dirname "$0")" -# export base="$(pwd)" - function try { "$@" || sleep 0; } function v(){ echo -e "####################################################" @@ -253,9 +249,9 @@ function show_progress() { fi } -# Enhanced: Cleanup temporary files on exit -declare -a TEMP_FILES_TO_CLEANUP=() +# Enhanced: Cleanup temporary files on exit +#declare -a TEMP_FILES_TO_CLEANUP=() function register_temp_file() { local temp_file="$1" TEMP_FILES_TO_CLEANUP+=("$temp_file") diff --git a/sdata/lib/options-install.sh b/sdata/lib/options-install.sh index 6f1a4472a..6d5cab787 100644 --- a/sdata/lib/options-install.sh +++ b/sdata/lib/options-install.sh @@ -26,7 +26,7 @@ Options for install: } cleancache(){ - rm -rf "$base/cache" + rm -rf "${REPO_ROOT}/cache" } # `man getopt` to see more diff --git a/sdata/lib/options.sh b/sdata/lib/options.sh index 8138c5173..cc4fdeddc 100644 --- a/sdata/lib/options.sh +++ b/sdata/lib/options.sh @@ -3,8 +3,6 @@ # shellcheck shell=bash -# The script that use this file should have two lines on its top as follows: -# cd "$(dirname "$0")" export base="$(pwd)" showhelp_global(){ echo -e "Syntax: $0 [subcommand] [options]... diff --git a/sdata/lib/package-installers.sh b/sdata/lib/package-installers.sh index 68c76ced2..c89d8009e 100644 --- a/sdata/lib/package-installers.sh +++ b/sdata/lib/package-installers.sh @@ -6,10 +6,6 @@ # This file is provided for any distros, mainly non-Arch(based) distros. -# The script that use this file should have two lines on its top as follows: -# cd "$(dirname "$0")" -# export base="$(pwd)" - install-agsv1(){ x mkdir -p $REPO_ROOT/cache/agsv1 x cd $REPO_ROOT/cache/agsv1 diff --git a/sdist/arch/install-deps.sh b/sdist/arch/install-deps.sh index 4d2de1f96..a537a5780 100644 --- a/sdist/arch/install-deps.sh +++ b/sdist/arch/install-deps.sh @@ -8,7 +8,7 @@ install-yay(){ x makepkg -o x makepkg -se x makepkg -i --noconfirm - x cd $base + x cd ${REPO_ROOT} rm -rf /tmp/buildyay }