From 94a730029befecfbba811eef884a4c03cdae0c39 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 29 Feb 2024 20:48:27 +0100 Subject: [PATCH] LOGGER: enhanced logging in dir_prep, update_splashscreens, set_setting_value, prepare_components: es-de --- functions/functions.sh | 8 +++++--- functions/patching.sh | 2 ++ functions/prepare_component.sh | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/functions/functions.sh b/functions/functions.sh index 9fc28d2b..2a24fe22 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -239,19 +239,19 @@ dir_prep() { real="$1" symlink="$2" - log d "[DIR PREP]\nMoving $symlink in $real" #DEBUG + log d "Preparing directory $symlink in $real" # if the symlink dir is already a symlink, unlink it first, to prevent recursion if [ -L "$symlink" ]; then - log d "$symlink is already a symlink, unlinking to prevent recursives" #DEBUG + log d "$symlink is already a symlink, unlinking to prevent recursives" unlink "$symlink" fi # if the dest dir exists we want to backup it if [ -d "$symlink" ]; then - log d "$symlink found" #DEBUG + log d "$symlink found" mv -f "$symlink" "$symlink.old" fi @@ -574,6 +574,8 @@ update_splashscreens() { # This script will purge any existing ES graphics and reload them from RO space into somewhere ES will look for it # USAGE: update_splashscreens + log i "Updating splash screen" + rm -rf /var/config/ES-DE/resources/graphics rsync -rlD --mkpath "/app/retrodeck/graphics/" "/var/config/ES-DE/resources/graphics/" diff --git a/functions/patching.sh b/functions/patching.sh index 368f6529..d6ac1dbb 100644 --- a/functions/patching.sh +++ b/functions/patching.sh @@ -8,6 +8,8 @@ set_setting_value() { local setting_value_to_change=$(sed -e 's^\\^\\\\^g;s^`^\\`^g' <<< "$3") local current_section_name=$(sed -e 's/%/\\%/g' <<< "$5") + log d "Setting $setting_name_to_change=$setting_value_to_change" + case $4 in "retrodeck" | "citra" | "melonds" | "yuzu" ) diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 913f3d0d..d4936fe5 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -41,14 +41,18 @@ prepare_component() { fi if [[ "$component" =~ ^(es-de|ES-DE|all)$ ]]; then # For use after ESDE-related folders are moved or a reset + log d "Preparing component: ES-DE" if [[ "$action" == "reset" ]]; then + log d "Reset action si triggered for: ES-DE" rm -rf /var/config/ES-DE create_dir /var/config/ES-DE/settings + log d "Initializing es_settings.xml" cp -f /app/retrodeck/es_settings.xml /var/config/ES-DE/settings/es_settings.xml set_setting_value "$es_settings" "ROMDirectory" "$roms_folder" "es_settings" set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings" set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings" dir_prep "$rdhome/gamelists" "/var/config/ES-DE/gamelists" + log d "Generating roms system folders" es-de --home /var/config/ES-DE --create-system-dirs update_splashscreens fi