Pārlūkot izejas kodu

fix(deps): fetch distro dependency csv when run as root before install (#5132)

fn_check_file only set checkflag when the script log already existed. Running install or auto-install as root before the game user had installed left checkflag empty, so check_deps.sh skipped fetching the distro dependency CSV and reported dependency checking as unavailable.

Set checkflag regardless of the log state; only the log writes remain guarded.

Fixes #3774
Daniel Gibbs 2 dienas atpakaļ
vecāks
revīzija
70818f4639
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      lgsm/modules/core_dl.sh

+ 3 - 3
lgsm/modules/core_dl.sh

@@ -412,17 +412,17 @@ fn_check_file() {
 		if [ "${exitcode}" -ne 0 ]; then
 		if [ "${exitcode}" -ne 0 ]; then
 			if [ ${counter} -ge 2 ]; then
 			if [ ${counter} -ge 2 ]; then
 				fn_print_fail_eol_nl
 				fn_print_fail_eol_nl
+				checkflag=1
 				if [ -f "${lgsmlog}" ]; then
 				if [ -f "${lgsmlog}" ]; then
 					fn_script_log_fail "Checking ${remote_filename}"
 					fn_script_log_fail "Checking ${remote_filename}"
 					fn_script_log_fail "${fileurl}"
 					fn_script_log_fail "${fileurl}"
-					checkflag=1
 				fi
 				fi
 			else
 			else
 				fn_print_error_eol_nl
 				fn_print_error_eol_nl
+				checkflag=2
 				if [ -f "${lgsmlog}" ]; then
 				if [ -f "${lgsmlog}" ]; then
 					fn_script_log_error "Checking ${remote_filename}"
 					fn_script_log_error "Checking ${remote_filename}"
 					fn_script_log_error "${fileurl}"
 					fn_script_log_error "${fileurl}"
-					checkflag=2
 				fi
 				fi
 			fi
 			fi
 		else
 		else
@@ -432,9 +432,9 @@ fn_check_file() {
 				fn_print_ok_eol
 				fn_print_ok_eol
 				echo -en "\033[2K\\r"
 				echo -en "\033[2K\\r"
 			fi
 			fi
+			checkflag=0
 			if [ -f "${lgsmlog}" ]; then
 			if [ -f "${lgsmlog}" ]; then
 				fn_script_log_pass "Checking ${remote_filename}"
 				fn_script_log_pass "Checking ${remote_filename}"
-				checkflag=0
 			fi
 			fi
 			break
 			break
 		fi
 		fi