LOGGER: enhanced logging in dir_prep, update_splashscreens, set_setting_value, prepare_components: es-de

This commit is contained in:
XargonWan 2024-02-29 20:48:27 +01:00
parent f321ad5f29
commit 94a730029b
3 changed files with 11 additions and 3 deletions

View file

@ -239,19 +239,19 @@ dir_prep() {
real="$1" real="$1"
symlink="$2" 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 the symlink dir is already a symlink, unlink it first, to prevent recursion
if [ -L "$symlink" ]; if [ -L "$symlink" ];
then 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" unlink "$symlink"
fi fi
# if the dest dir exists we want to backup it # if the dest dir exists we want to backup it
if [ -d "$symlink" ]; if [ -d "$symlink" ];
then then
log d "$symlink found" #DEBUG log d "$symlink found"
mv -f "$symlink" "$symlink.old" mv -f "$symlink" "$symlink.old"
fi 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 # This script will purge any existing ES graphics and reload them from RO space into somewhere ES will look for it
# USAGE: update_splashscreens # USAGE: update_splashscreens
log i "Updating splash screen"
rm -rf /var/config/ES-DE/resources/graphics rm -rf /var/config/ES-DE/resources/graphics
rsync -rlD --mkpath "/app/retrodeck/graphics/" "/var/config/ES-DE/resources/graphics/" rsync -rlD --mkpath "/app/retrodeck/graphics/" "/var/config/ES-DE/resources/graphics/"

View file

@ -8,6 +8,8 @@ set_setting_value() {
local setting_value_to_change=$(sed -e 's^\\^\\\\^g;s^`^\\`^g' <<< "$3") local setting_value_to_change=$(sed -e 's^\\^\\\\^g;s^`^\\`^g' <<< "$3")
local current_section_name=$(sed -e 's/%/\\%/g' <<< "$5") local current_section_name=$(sed -e 's/%/\\%/g' <<< "$5")
log d "Setting $setting_name_to_change=$setting_value_to_change"
case $4 in case $4 in
"retrodeck" | "citra" | "melonds" | "yuzu" ) "retrodeck" | "citra" | "melonds" | "yuzu" )

View file

@ -41,14 +41,18 @@ prepare_component() {
fi fi
if [[ "$component" =~ ^(es-de|ES-DE|all)$ ]]; then # For use after ESDE-related folders are moved or a reset 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 if [[ "$action" == "reset" ]]; then
log d "Reset action si triggered for: ES-DE"
rm -rf /var/config/ES-DE rm -rf /var/config/ES-DE
create_dir /var/config/ES-DE/settings 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 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" "ROMDirectory" "$roms_folder" "es_settings"
set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings" set_setting_value "$es_settings" "MediaDirectory" "$media_folder" "es_settings"
set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings" set_setting_value "$es_settings" "UserThemeDirectory" "$themes_folder" "es_settings"
dir_prep "$rdhome/gamelists" "/var/config/ES-DE/gamelists" 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 es-de --home /var/config/ES-DE --create-system-dirs
update_splashscreens update_splashscreens
fi fi