Repository navigation
Conversation
…apply the console language
…a languages-v1 release
…plit the preinit into b8020/p8020
… its glyphs to the fonts
…anguage is applied
Show the waiting splashes with a moving bar and move the patches out
…micom, and drop the classic mechanism
…chi sync can clean the storage
…download is never taken for installed
…only when it is new
marcolinoambrosio
left a comment
There was a problem hiding this comment.
Review focused on locale handling, persistence and language installation.
| local var_5_4 = var_0_0[var_5_3] | ||
| local var_5_5 = table_find_if(arg_5_0.elementArray, function(arg_7_0) | ||
| return arg_7_0.language == var_5_4.caption | ||
| end) |
There was a problem hiding this comment.
Could we guard against var_5_3 being nil here? If the current locale is not present in var_0_0, var_5_4 becomes nil and var_5_4.caption below will fail.
| mkdir -p "$cl_home/custom/$cl_pack" | ||
| mv "$stage/custom/$cl_pack/$code" "$cl_home/custom/$cl_pack/$code" || rc=1 | ||
| fi | ||
| rm -rf "$stage" |
There was a problem hiding this comment.
Is it guaranteed that this path can never install the currently active language? clInstall() stages an active language as <code>.new, but clInstalled() writes directly to <code>. If that invariant is not guaranteed here, could we reuse the same staging logic?
| fi | ||
| case "$cl_code" in usa_en | eur_de | eur_es | eur_fr | eur_it | eur_nl | eur_pt | eur_ru) | ||
| if [ -n "$cl_native" ]; then | ||
| rm -f "$cl_dir/active.$cl_system" |
There was a problem hiding this comment.
What guarantees that the selected stock language has already been persisted by the firmware before we remove active.$cl_system here? Could we add an upgrade test where the previous version has an active stock language and verify that it survives the first reboot?
| # the classic mechanism stores the pack, the firmware menu the language | ||
| if [ -n "$cl_native" ] && [ -n "$cl_code" ] && [ -d "$cl_dir/custom/$cl_pack/$cl_code" ]; then | ||
| cl_code="$(clNativeCode "$cl_code")" | ||
| echo "$cl_code" >"$cl_dir/active.$cl_system" |
There was a problem hiding this comment.
Could this migration write be atomic as well? The Lua side explicitly uses mcp.write_file_atomic() for active.*, but this path truncates the persisted state before writing the migrated code. A temporary file plus rename would keep the same persistence guarantee during boot migration.
| end) | ||
| local var_13_3 = var_0_0[var_13_2] | ||
|
|
||
| if var_13_3.extra then |
There was a problem hiding this comment.
Could we guard against var_13_2 being nil before dereferencing var_13_3? The visible language slots are dynamically refreshed, so if the selected button no longer maps to an entry in var_0_0, this will fail on var_13_3.extra.
| rm -rf "$stage" | ||
| translate CL_REPLACE_AT_REBOOT | ||
| else | ||
| rm -rf "$dest" |
There was a problem hiding this comment.
Could we verify that $stage/custom/$cl_pack/$1 exists before removing $dest? Otherwise an archive that unpacks successfully but does not contain the expected directory could remove the currently installed language before the mv fails.
No description provided.