Ventoy 1.1.18 sources and Paravis patches
This commit is contained in:
commit
cd02c606e6
187 files changed
+94477
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
F=${1:?usage: patch-ventoy-lang.sh <path-to-vtoyefi/grub/grub.cfg>}
|
||||
python3 - "$F" <<'EOF'
|
||||
import io, sys
|
||||
p = sys.argv[1]
|
||||
s = io.open(p, encoding='utf-8', newline='').read()
|
||||
old = '''if [ -n "$VTOY_MENU_LANGUAGE" ]; then
|
||||
vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
|
||||
else
|
||||
vt_init_menu_lang en_US
|
||||
fi'''
|
||||
new = '''if [ -n "$VTOY_MENU_LANGUAGE" ]; then
|
||||
vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
|
||||
else
|
||||
vt_init_menu_lang ru_RU
|
||||
fi'''
|
||||
if new in s:
|
||||
print("already patched")
|
||||
elif old in s:
|
||||
s = s.replace(old, new, 1)
|
||||
io.open(p, 'w', encoding='utf-8', newline='').write(s)
|
||||
print("patched: default menu language -> ru_RU")
|
||||
else:
|
||||
print("BLOCK NOT FOUND")
|
||||
sys.exit(1)
|
||||
EOF
|
||||
grep -n -A3 'VTOY_MENU_LANGUAGE' "$F" | head -12
|
||||
Reference in new issue
Block a user