mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
Merge pull request #824 from icenine451/cooker-0.8.2b-icenine451
Cooker 0.8.2b icenine451
This commit is contained in:
commit
654a0b6a47
|
@ -50,7 +50,7 @@ cat "$automation_task_list"
|
|||
echo
|
||||
|
||||
# Update all collected information
|
||||
while IFS="^" read -r action placeholder url branch
|
||||
while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]];
|
||||
do
|
||||
if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then
|
||||
case "$action" in
|
||||
|
|
|
@ -156,12 +156,14 @@ check_for_version_update() {
|
|||
}
|
||||
|
||||
validate_input() {
|
||||
while IFS="^" read -r input action
|
||||
while IFS="^" read -r input action || [[ -n "$input" ]];
|
||||
do
|
||||
if [[ ! $input == "#"* ]] && [[ ! -z "$input" ]]; then
|
||||
if [[ "$input" == "$1" ]]; then
|
||||
eval "$action"
|
||||
input_validated="true"
|
||||
fi
|
||||
fi
|
||||
done < $input_validation
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,9 @@ check_bios_files() {
|
|||
fi
|
||||
touch "$godot_bios_files_checked"
|
||||
|
||||
while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc
|
||||
while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc || [[ -n "$bios_file" ]];
|
||||
do
|
||||
if [[ ! $bios_file == "#"* ]] && [[ ! -z "$bios_file" ]]; then
|
||||
bios_file_found="No"
|
||||
bios_hash_matched="No"
|
||||
if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then
|
||||
|
@ -29,6 +30,7 @@ check_bios_files() {
|
|||
bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash")
|
||||
echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file
|
||||
fi
|
||||
fi
|
||||
done < $bios_checklist
|
||||
}
|
||||
|
||||
|
@ -44,7 +46,7 @@ find_empty_rom_folders() {
|
|||
all_empty_folders=()
|
||||
all_helper_files=()
|
||||
|
||||
while IFS='^' read -r file dest
|
||||
while IFS='^' read -r file dest || [[ -n "$file" ]];
|
||||
do
|
||||
if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then
|
||||
all_helper_files=("${all_helper_files[@]}" "$file")
|
||||
|
|
|
@ -410,9 +410,9 @@ deploy_single_patch() {
|
|||
|
||||
cp -fv "$1" "$3" # Create a copy of the original file to be patched
|
||||
|
||||
while IFS="^" read -r action current_section setting_name setting_value system_name
|
||||
while IFS="^" read -r action current_section setting_name setting_value system_name || [[ -n "$action" ]];
|
||||
do
|
||||
|
||||
if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then
|
||||
case $action in
|
||||
|
||||
"disable_file" )
|
||||
|
@ -442,15 +442,12 @@ do
|
|||
set_setting_value "$3" "$setting_name" "$setting_value" "$system_name" "$current_section"
|
||||
;;
|
||||
|
||||
*"#"* )
|
||||
# Comment line in patch file
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Config line malformed: $action"
|
||||
log e "Config line malformed: $action"
|
||||
;;
|
||||
|
||||
esac
|
||||
fi
|
||||
done < "$2"
|
||||
}
|
||||
|
||||
|
@ -461,8 +458,9 @@ deploy_multi_patch() {
|
|||
# Patch file format should be as follows, with optional entries in (). Optional settings can be left empty, but must still have ^ dividers:
|
||||
# $action^($current_section)^$setting_name^$setting_value^$system_name^($config file)
|
||||
|
||||
while IFS="^" read -r action current_section setting_name setting_value system_name config_file
|
||||
while IFS="^" read -r action current_section setting_name setting_value system_name config_file || [[ -n "$action" ]];
|
||||
do
|
||||
if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then
|
||||
case $action in
|
||||
|
||||
"disable_file" )
|
||||
|
@ -507,14 +505,11 @@ do
|
|||
set_setting_value "$config_file" "$setting_name" "$setting_value" "$system_name" "$current_section"
|
||||
;;
|
||||
|
||||
*"#"* )
|
||||
# Comment line in patch file
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Config line malformed: $action"
|
||||
log e "Config line malformed: $action"
|
||||
;;
|
||||
|
||||
esac
|
||||
fi
|
||||
done < "$1"
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ multi_user_determine_current_user() {
|
|||
|
||||
multi_user_return_to_single_user() {
|
||||
single_user="$1"
|
||||
echo "Returning to single-user mode for $single_user"
|
||||
log i "Returning to single-user mode for $single_user"
|
||||
unlink "$saves_folder"
|
||||
unlink "$states_folder"
|
||||
unlink "$rd_conf"
|
||||
|
@ -182,7 +182,7 @@ multi_user_return_to_single_user() {
|
|||
|
||||
multi_user_setup_new_user() {
|
||||
# TODO: RPCS3 one-offs
|
||||
echo "Setting up new user"
|
||||
log i "Setting up new user"
|
||||
unlink "$saves_folder"
|
||||
unlink "$states_folder"
|
||||
dir_prep "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
|
||||
|
@ -220,7 +220,7 @@ multi_user_setup_new_user() {
|
|||
}
|
||||
|
||||
multi_user_link_current_user_files() {
|
||||
echo "Linking existing user"
|
||||
log i "Linking existing user"
|
||||
ln -sfT "$multi_user_data_folder/$SteamAppUser/saves" "$saves_folder"
|
||||
ln -sfT "$multi_user_data_folder/$SteamAppUser/states" "$states_folder"
|
||||
ln -sfT "$multi_user_data_folder/$SteamAppUser/config/retrodeck/retrodeck.cfg" "$rd_conf"
|
||||
|
|
|
@ -361,9 +361,11 @@ done
|
|||
finit_user_options_dialog() {
|
||||
finit_available_options=()
|
||||
|
||||
while IFS="^" read -r enabled option_name option_desc option_tag
|
||||
while IFS="^" read -r enabled option_name option_desc option_tag || [[ -n "$enabled" ]];
|
||||
do
|
||||
if [[ ! $enabled == "#"* ]] && [[ ! -z "$enabled" ]]; then
|
||||
finit_available_options=("${finit_available_options[@]}" "$enabled" "$option_name" "$option_desc" "$option_tag")
|
||||
fi
|
||||
done < $finit_options_list
|
||||
|
||||
|
||||
|
@ -561,7 +563,7 @@ deploy_helper_files() {
|
|||
# This script will distribute helper documentation files throughout the filesystem according to the $helper_files_list
|
||||
# USAGE: deploy_helper_files
|
||||
|
||||
while IFS='^' read -r file dest
|
||||
while IFS='^' read -r file dest || [[ -n "$file" ]];
|
||||
do
|
||||
if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then
|
||||
eval current_dest="$dest"
|
||||
|
@ -579,14 +581,16 @@ easter_eggs() {
|
|||
current_day=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges
|
||||
current_time=$(date +"%0H%0M") # Read the current time in a format that can be calculated in ranges
|
||||
if [[ ! -z $(cat $easter_egg_checklist) ]]; then
|
||||
while IFS="^" read -r start_date end_date start_time end_time splash_file # Read Easter Egg checklist file and separate values
|
||||
while IFS="^" read -r start_date end_date start_time end_time splash_file || [[ -n "$start_date" ]]; # Read Easter Egg checklist file and separate values
|
||||
do
|
||||
if [[ ! $start_date == "#"* ]] && [[ ! -z "$start_date" ]]; then
|
||||
if [[ "$((10#$current_day))" -ge "$((10#$start_date))" && "$((10#$current_day))" -le "$((10#$end_date))" && "$((10#$current_time))" -ge "$((10#$start_time))" && "$((10#$current_time))" -le "$((10#$end_time))" ]]; then # If current line specified date/time matches current date/time, set $splash_file to be deployed
|
||||
new_splash_file="$splashscreen_dir/$splash_file"
|
||||
break
|
||||
else # When there are no matches, the default splash screen is set to deploy
|
||||
new_splash_file="$default_splash_file"
|
||||
fi
|
||||
fi
|
||||
done < $easter_egg_checklist
|
||||
else
|
||||
new_splash_file="$default_splash_file"
|
||||
|
|
|
@ -28,7 +28,7 @@ change_preset_dialog() {
|
|||
--title "RetroDECK Configurator Utility - Presets Configuration" \
|
||||
--text="Setting up your presets, please wait..."
|
||||
else
|
||||
echo "No choices made"
|
||||
log i "No preset choices made"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -79,13 +79,16 @@ make_preset_changes() {
|
|||
fi
|
||||
set_setting_value "$rd_conf" "$emulator" "true" "retrodeck" "$preset"
|
||||
# Check for conflicting presets for this system
|
||||
while IFS=: read -r preset_being_checked known_incompatible_preset; do
|
||||
while IFS=: read -r preset_being_checked known_incompatible_preset || [[ -n "$preset_being_checked" ]];
|
||||
do
|
||||
if [[ ! $preset_being_checked == "#"* ]] && [[ ! -z "$preset_being_checked" ]]; then
|
||||
if [[ "$preset" == "$preset_being_checked" ]]; then
|
||||
if [[ $(get_setting_value "$rd_conf" "$emulator" "retrodeck" "$known_incompatible_preset") == "true" ]]; then
|
||||
changed_presets=("${changed_presets[@]}" "$known_incompatible_preset")
|
||||
set_setting_value "$rd_conf" "$emulator" "false" "retrodeck" "$known_incompatible_preset"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done < "$incompatible_presets_reference_list"
|
||||
fi
|
||||
if [[ ! " ${choices[*]} " =~ " ${emulator} " && ! " ${current_disabled_systems[*]} " =~ " ${emulator} " ]]; then
|
||||
|
@ -116,8 +119,9 @@ build_preset_config() {
|
|||
local read_system_name=$(get_setting_name "$system_line")
|
||||
if [[ "$read_system_name" == "$system_being_changed" ]]; then
|
||||
local read_system_enabled=$(get_setting_value "$rd_conf" "$read_system_name" "retrodeck" "$current_preset")
|
||||
while IFS='^' read -r action read_preset read_setting_name new_setting_value section target_file defaults_file
|
||||
while IFS='^' read -r action read_preset read_setting_name new_setting_value section target_file defaults_file || [[ -n "$action" ]];
|
||||
do
|
||||
if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then
|
||||
case "$action" in
|
||||
|
||||
"config_file_format" )
|
||||
|
@ -187,10 +191,11 @@ build_preset_config() {
|
|||
;;
|
||||
|
||||
* )
|
||||
echo "Other data: $action $read_preset $read_setting_name $new_setting_value $section" # DEBUG
|
||||
log d "Other data: $action $read_preset $read_setting_name $new_setting_value $section" # DEBUG
|
||||
;;
|
||||
|
||||
esac
|
||||
fi
|
||||
done < <(cat "$presets_dir/$read_system_name"_presets.cfg)
|
||||
fi
|
||||
done < <(printf '%s\n' "$preset_section")
|
||||
|
@ -202,7 +207,7 @@ build_retrodeck_current_presets() {
|
|||
# This can also be used to build the "current" state post-update after adding new systems
|
||||
# USAGE: build_retrodeck_current_presets
|
||||
|
||||
while IFS= read -r current_setting_line # Read the existing retrodeck.cfg
|
||||
while IFS= read -r current_setting_line || [[ -n "$current_setting_line" ]]; # Read the existing retrodeck.cfg
|
||||
do
|
||||
if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it
|
||||
if [[ ! -z $(grep -o -P "^\[.+?\]$" <<< "$current_setting_line") ]]; then # If the line is a section header
|
||||
|
|
Loading…
Reference in a new issue