Merge pull request #423 from outis1one/claude/wolf-pair-port-conflict-7nz8qg
wolf: fix TI-99/4A ES-DE command line never actually updating on re-run
This commit is contained in:
+23
-13
@@ -966,12 +966,22 @@ UDEV
|
||||
if [[ "$_GET_TI99" =~ ^[Yy]$ ]]; then
|
||||
mkdir -p "$GAME_STORAGE_DIR/esde-custom-systems" "$GAME_STORAGE_DIR/roms/ti994a"
|
||||
local _TI99_XML="$GAME_STORAGE_DIR/esde-custom-systems/es_systems.xml"
|
||||
if [ ! -f "$_TI99_XML" ] || ! grep -q '<name>ti994a</name>' "$_TI99_XML" 2>/dev/null; then
|
||||
backup_if_exists "$_TI99_XML"
|
||||
[ -f "$_TI99_XML" ] || echo '<systemList>' > "$_TI99_XML"
|
||||
sed -i 's#</systemList>##' "$_TI99_XML" 2>/dev/null
|
||||
cat >> "$_TI99_XML" << 'XMLEOF'
|
||||
<system>
|
||||
backup_if_exists "$_TI99_XML"
|
||||
# Always strip and re-add the ti994a block rather than "skip if
|
||||
# already present" — confirmed live: that check left a stale
|
||||
# <command> line in place across a real fix to it, since existing
|
||||
# was already "present" and the check never looked at whether its
|
||||
# content matched the current template.
|
||||
python3 - "$_TI99_XML" << 'TI99XMLPY'
|
||||
import re, sys
|
||||
path = sys.argv[1]
|
||||
try:
|
||||
with open(path) as f:
|
||||
content = f.read()
|
||||
except FileNotFoundError:
|
||||
content = '<systemList>\n</systemList>\n'
|
||||
content = re.sub(r'[ \t]*<system>\s*<name>ti994a</name>.*?</system>\s*\n?', '', content, flags=re.DOTALL)
|
||||
block = ''' <system>
|
||||
<name>ti994a</name>
|
||||
<fullname>Texas Instruments TI-99/4A</fullname>
|
||||
<path>%ROMPATH%/ti994a</path>
|
||||
@@ -980,13 +990,13 @@ UDEV
|
||||
<platform>ti99</platform>
|
||||
<theme>ti99</theme>
|
||||
</system>
|
||||
</systemList>
|
||||
XMLEOF
|
||||
chown "$ACTUAL_USER:$ACTUAL_USER" "$_TI99_XML"
|
||||
log_success "TI-99/4A added as an ES-DE system (roms/ti994a/, custom_systems/es_systems.xml)"
|
||||
else
|
||||
log_info "TI-99/4A system definition already present — left as-is."
|
||||
fi
|
||||
'''
|
||||
content = content.replace('</systemList>', block + '</systemList>')
|
||||
with open(path, 'w') as f:
|
||||
f.write(content)
|
||||
TI99XMLPY
|
||||
chown "$ACTUAL_USER:$ACTUAL_USER" "$_TI99_XML"
|
||||
log_success "TI-99/4A ES-DE system definition written/refreshed (roms/ti994a/, custom_systems/es_systems.xml)"
|
||||
echo ""
|
||||
if [ ! -x "$GAME_STORAGE_DIR/emulators/ti99sim-sdl" ]; then
|
||||
# Build inside a container running the EXACT SAME image ES-DE
|
||||
|
||||
Reference in New Issue
Block a user