mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-01-09 19:05:39 +00:00
MIME: added a tool to automatically generate the mime files based on es_systems and updated the actual mime file.
This commit is contained in:
parent
c5d612809d
commit
d62218c6e4
|
@ -2,6 +2,8 @@
|
||||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
<mime-type type="application/retro-game">
|
<mime-type type="application/retro-game">
|
||||||
<comment>Retro Game</comment>
|
<comment>Retro Game</comment>
|
||||||
|
<glob pattern="*.0"/>
|
||||||
|
<glob pattern="*.1dd"/>
|
||||||
<glob pattern="*.2d"/>
|
<glob pattern="*.2d"/>
|
||||||
<glob pattern="*.2hd"/>
|
<glob pattern="*.2hd"/>
|
||||||
<glob pattern="*.2mg"/>
|
<glob pattern="*.2mg"/>
|
||||||
|
@ -26,6 +28,7 @@
|
||||||
<glob pattern="*.agb"/>
|
<glob pattern="*.agb"/>
|
||||||
<glob pattern="*.apd"/>
|
<glob pattern="*.apd"/>
|
||||||
<glob pattern="*.app"/>
|
<glob pattern="*.app"/>
|
||||||
|
<glob pattern="*.arcadedef"/>
|
||||||
<glob pattern="*.arduboy"/>
|
<glob pattern="*.arduboy"/>
|
||||||
<glob pattern="*.atr"/>
|
<glob pattern="*.atr"/>
|
||||||
<glob pattern="*.atx"/>
|
<glob pattern="*.atx"/>
|
||||||
|
@ -40,6 +43,7 @@
|
||||||
<glob pattern="*.car"/>
|
<glob pattern="*.car"/>
|
||||||
<glob pattern="*.cas"/>
|
<glob pattern="*.cas"/>
|
||||||
<glob pattern="*.cbn"/>
|
<glob pattern="*.cbn"/>
|
||||||
|
<glob pattern="*.ccc"/>
|
||||||
<glob pattern="*.ccd"/>
|
<glob pattern="*.ccd"/>
|
||||||
<glob pattern="*.cci"/>
|
<glob pattern="*.cci"/>
|
||||||
<glob pattern="*.cdi"/>
|
<glob pattern="*.cdi"/>
|
||||||
|
@ -80,66 +84,256 @@
|
||||||
<glob pattern="*.d88"/>
|
<glob pattern="*.d88"/>
|
||||||
<glob pattern="*.d8z"/>
|
<glob pattern="*.d8z"/>
|
||||||
<glob pattern="*.d98"/>
|
<glob pattern="*.d98"/>
|
||||||
|
<glob pattern="*.daphne"/>
|
||||||
<glob pattern="*.dat"/>
|
<glob pattern="*.dat"/>
|
||||||
<glob pattern="*.ddp"/>
|
<glob pattern="*.ddp"/>
|
||||||
<glob pattern="*.dfi"/>c
|
<glob pattern="*.desktop"/>
|
||||||
|
<glob pattern="*.dff"/>
|
||||||
|
<glob pattern="*.dfi"/>
|
||||||
|
<glob pattern="*.di1"/>
|
||||||
|
<glob pattern="*.di2"/>
|
||||||
<glob pattern="*.dim"/>
|
<glob pattern="*.dim"/>
|
||||||
|
<glob pattern="*.dirksimple"/>
|
||||||
|
<glob pattern="*.dmg"/>
|
||||||
|
<glob pattern="*.dmk"/>
|
||||||
<glob pattern="*.dms"/>
|
<glob pattern="*.dms"/>
|
||||||
<glob pattern="*.do"/>
|
<glob pattern="*.do"/>
|
||||||
<glob pattern="*.doom"/>
|
|
||||||
<glob pattern="*.dol"/>
|
<glob pattern="*.dol"/>
|
||||||
|
<glob pattern="*.doom"/>
|
||||||
<glob pattern="*.dosz"/>
|
<glob pattern="*.dosz"/>
|
||||||
|
<glob pattern="*.dsd"/>
|
||||||
<glob pattern="*.dsk"/>
|
<glob pattern="*.dsk"/>
|
||||||
<glob pattern="*.dump"/>
|
<glob pattern="*.dump"/>
|
||||||
|
<glob pattern="*.dup"/>
|
||||||
<glob pattern="*.dx1"/>
|
<glob pattern="*.dx1"/>
|
||||||
|
<glob pattern="*.dx2"/>
|
||||||
<glob pattern="*.easyrpg"/>
|
<glob pattern="*.easyrpg"/>
|
||||||
<glob pattern="*.ecm"/>
|
<glob pattern="*.ecm"/>
|
||||||
<glob pattern="*.elf"/>
|
<glob pattern="*.elf"/>
|
||||||
<glob pattern="*.exe"/>
|
<glob pattern="*.exe"/>
|
||||||
|
<glob pattern="*.fd"/>
|
||||||
|
<glob pattern="*.fd1"/>
|
||||||
|
<glob pattern="*.fd2"/>
|
||||||
|
<glob pattern="*.fdd"/>
|
||||||
<glob pattern="*.fdi"/>
|
<glob pattern="*.fdi"/>
|
||||||
|
<glob pattern="*.fds"/>
|
||||||
|
<glob pattern="*.fig"/>
|
||||||
|
<glob pattern="*.fpt"/>
|
||||||
|
<glob pattern="*.g41"/>
|
||||||
|
<glob pattern="*.g4z"/>
|
||||||
|
<glob pattern="*.g64"/>
|
||||||
|
<glob pattern="*.g6z"/>
|
||||||
|
<glob pattern="*.gam"/>
|
||||||
|
<glob pattern="*.game"/>
|
||||||
<glob pattern="*.gb"/>
|
<glob pattern="*.gb"/>
|
||||||
<glob pattern="*.gba"/>
|
<glob pattern="*.gba"/>
|
||||||
<glob pattern="*.gbc"/>
|
<glob pattern="*.gbc"/>
|
||||||
<glob pattern="*.gc"/>
|
<glob pattern="*.gcm"/>
|
||||||
|
<glob pattern="*.gcz"/>
|
||||||
|
<glob pattern="*.gd3"/>
|
||||||
|
<glob pattern="*.gd7"/>
|
||||||
|
<glob pattern="*.gdi"/>
|
||||||
<glob pattern="*.gen"/>
|
<glob pattern="*.gen"/>
|
||||||
<glob pattern="*.gg"/>
|
<glob pattern="*.gg"/>
|
||||||
<glob pattern="*.fds"/>
|
<glob pattern="*.gz"/>
|
||||||
<glob pattern="*.gdi"/>
|
<glob pattern="*.hdd"/>
|
||||||
<glob pattern="*.hdf"/>
|
<glob pattern="*.hdf"/>
|
||||||
|
<glob pattern="*.hdi"/>
|
||||||
|
<glob pattern="*.hdm"/>
|
||||||
|
<glob pattern="*.hdn"/>
|
||||||
<glob pattern="*.hdz"/>
|
<glob pattern="*.hdz"/>
|
||||||
|
<glob pattern="*.hex"/>
|
||||||
|
<glob pattern="*.hfe"/>
|
||||||
|
<glob pattern="*.ima"/>
|
||||||
|
<glob pattern="*.imd"/>
|
||||||
<glob pattern="*.img"/>
|
<glob pattern="*.img"/>
|
||||||
|
<glob pattern="*.int"/>
|
||||||
<glob pattern="*.ipf"/>
|
<glob pattern="*.ipf"/>
|
||||||
|
<glob pattern="*.ipk3"/>
|
||||||
<glob pattern="*.iso"/>
|
<glob pattern="*.iso"/>
|
||||||
|
<glob pattern="*.isz"/>
|
||||||
|
<glob pattern="*.iwad"/>
|
||||||
|
<glob pattern="*.j64"/>
|
||||||
|
<glob pattern="*.jag"/>
|
||||||
|
<glob pattern="*.jar"/>
|
||||||
|
<glob pattern="*.jfd"/>
|
||||||
|
<glob pattern="*.json"/>
|
||||||
|
<glob pattern="*.k7"/>
|
||||||
<glob pattern="*.kcr"/>
|
<glob pattern="*.kcr"/>
|
||||||
<glob pattern="*.lha"/>
|
<glob pattern="*.lha"/>
|
||||||
|
<glob pattern="*.lnx"/>
|
||||||
|
<glob pattern="*.lst"/>
|
||||||
|
<glob pattern="*.lua"/>
|
||||||
|
<glob pattern="*.lutro"/>
|
||||||
<glob pattern="*.m3u"/>
|
<glob pattern="*.m3u"/>
|
||||||
|
<glob pattern="*.m5"/>
|
||||||
|
<glob pattern="*.m7"/>
|
||||||
<glob pattern="*.md"/>
|
<glob pattern="*.md"/>
|
||||||
|
<glob pattern="*.mdf"/>
|
||||||
<glob pattern="*.mds"/>
|
<glob pattern="*.mds"/>
|
||||||
<glob pattern="*.mdx"/>
|
<glob pattern="*.mdx"/>
|
||||||
|
<glob pattern="*.mfi"/>
|
||||||
|
<glob pattern="*.mfm"/>
|
||||||
|
<glob pattern="*.mgd"/>
|
||||||
|
<glob pattern="*.mgt"/>
|
||||||
|
<glob pattern="*.mgw"/>
|
||||||
|
<glob pattern="*.min"/>
|
||||||
|
<glob pattern="*.minipsf"/>
|
||||||
|
<glob pattern="*.msa"/>
|
||||||
|
<glob pattern="*.mugen"/>
|
||||||
|
<glob pattern="*.mx1"/>
|
||||||
|
<glob pattern="*.mx2"/>
|
||||||
|
<glob pattern="*.n64"/>
|
||||||
|
<glob pattern="*.nbz"/>
|
||||||
|
<glob pattern="*.nca"/>
|
||||||
|
<glob pattern="*.ndd"/>
|
||||||
|
<glob pattern="*.nds"/>
|
||||||
|
<glob pattern="*.neo"/>
|
||||||
<glob pattern="*.nes"/>
|
<glob pattern="*.nes"/>
|
||||||
|
<glob pattern="*.nex"/>
|
||||||
|
<glob pattern="*.ngage"/>
|
||||||
<glob pattern="*.ngc"/>
|
<glob pattern="*.ngc"/>
|
||||||
<glob pattern="*.ngp"/>
|
<glob pattern="*.ngp"/>
|
||||||
<glob pattern="*.ngpc"/>
|
<glob pattern="*.ngpc"/>
|
||||||
<glob pattern="*.nsp"/>
|
<glob pattern="*.ngr"/>
|
||||||
|
<glob pattern="*.nhd"/>
|
||||||
|
<glob pattern="*.nib"/>
|
||||||
<glob pattern="*.npc"/>
|
<glob pattern="*.npc"/>
|
||||||
<glob pattern="*.nrg"/>
|
<glob pattern="*.nrg"/>
|
||||||
|
<glob pattern="*.nro"/>
|
||||||
|
<glob pattern="*.nso"/>
|
||||||
|
<glob pattern="*.nsp"/>
|
||||||
|
<glob pattern="*.nx"/>
|
||||||
|
<glob pattern="*.o"/>
|
||||||
|
<glob pattern="*.ogv"/>
|
||||||
|
<glob pattern="*.ort"/>
|
||||||
|
<glob pattern="*.p"/>
|
||||||
|
<glob pattern="*.p00"/>
|
||||||
|
<glob pattern="*.p8"/>
|
||||||
|
<glob pattern="*.pak"/>
|
||||||
|
<glob pattern="*.pbp"/>
|
||||||
|
<glob pattern="*.pc2"/>
|
||||||
|
<glob pattern="*.pce"/>
|
||||||
|
<glob pattern="*.phd"/>
|
||||||
|
<glob pattern="*.pk3"/>
|
||||||
|
<glob pattern="*.pk4"/>
|
||||||
|
<glob pattern="*.png"/>
|
||||||
|
<glob pattern="*.po"/>
|
||||||
|
<glob pattern="*.pqa"/>
|
||||||
|
<glob pattern="*.prc"/>
|
||||||
|
<glob pattern="*.prg"/>
|
||||||
|
<glob pattern="*.prx"/>
|
||||||
|
<glob pattern="*.ps3"/>
|
||||||
|
<glob pattern="*.ps3dir"/>
|
||||||
|
<glob pattern="*.psexe"/>
|
||||||
|
<glob pattern="*.psf"/>
|
||||||
<glob pattern="*.psvita"/>
|
<glob pattern="*.psvita"/>
|
||||||
<glob pattern="*.pkg"/>
|
<glob pattern="*.psx"/>
|
||||||
|
<glob pattern="*.pwad"/>
|
||||||
|
<glob pattern="*.ri"/>
|
||||||
<glob pattern="*.rom"/>
|
<glob pattern="*.rom"/>
|
||||||
<glob pattern="*.rp9"/>
|
<glob pattern="*.rp9"/>
|
||||||
|
<glob pattern="*.rpk"/>
|
||||||
|
<glob pattern="*.rpx"/>
|
||||||
<glob pattern="*.rvz"/>
|
<glob pattern="*.rvz"/>
|
||||||
|
<glob pattern="*.rzx"/>
|
||||||
|
<glob pattern="*.sad"/>
|
||||||
|
<glob pattern="*.sap"/>
|
||||||
|
<glob pattern="*.sbt"/>
|
||||||
|
<glob pattern="*.sc"/>
|
||||||
|
<glob pattern="*.scl"/>
|
||||||
|
<glob pattern="*.scummvm"/>
|
||||||
|
<glob pattern="*.sfc"/>
|
||||||
<glob pattern="*.sg"/>
|
<glob pattern="*.sg"/>
|
||||||
|
<glob pattern="*.sgb"/>
|
||||||
<glob pattern="*.sgd"/>
|
<glob pattern="*.sgd"/>
|
||||||
|
<glob pattern="*.sgx"/>
|
||||||
|
<glob pattern="*.sh"/>
|
||||||
|
<glob pattern="*.singe"/>
|
||||||
|
<glob pattern="*.sis"/>
|
||||||
|
<glob pattern="*.sisx"/>
|
||||||
|
<glob pattern="*.smc"/>
|
||||||
<glob pattern="*.smd"/>
|
<glob pattern="*.smd"/>
|
||||||
<glob pattern="*.sms"/>
|
<glob pattern="*.sms"/>
|
||||||
<glob pattern="*.sna"/>
|
<glob pattern="*.sna"/>
|
||||||
<glob pattern="*.scummvm"/>
|
<glob pattern="*.solarus"/>
|
||||||
|
<glob pattern="*.ssd"/>
|
||||||
|
<glob pattern="*.st"/>
|
||||||
|
<glob pattern="*.stx"/>
|
||||||
|
<glob pattern="*.sv"/>
|
||||||
|
<glob pattern="*.svm"/>
|
||||||
|
<glob pattern="*.swc"/>
|
||||||
|
<glob pattern="*.swf"/>
|
||||||
|
<glob pattern="*.symbian"/>
|
||||||
|
<glob pattern="*.szx"/>
|
||||||
|
<glob pattern="*.t64"/>
|
||||||
|
<glob pattern="*.t77"/>
|
||||||
|
<glob pattern="*.t88"/>
|
||||||
<glob pattern="*.tap"/>
|
<glob pattern="*.tap"/>
|
||||||
|
<glob pattern="*.tar"/>
|
||||||
|
<glob pattern="*.td0"/>
|
||||||
|
<glob pattern="*.tfd"/>
|
||||||
|
<glob pattern="*.tgc"/>
|
||||||
|
<glob pattern="*.thd"/>
|
||||||
|
<glob pattern="*.tic"/>
|
||||||
|
<glob pattern="*.tmd"/>
|
||||||
|
<glob pattern="*.toc"/>
|
||||||
|
<glob pattern="*.trd"/>
|
||||||
|
<glob pattern="*.tzx"/>
|
||||||
|
<glob pattern="*.u1"/>
|
||||||
|
<glob pattern="*.u88"/>
|
||||||
<glob pattern="*.uae"/>
|
<glob pattern="*.uae"/>
|
||||||
|
<glob pattern="*.udi"/>
|
||||||
|
<glob pattern="*.uef"/>
|
||||||
|
<glob pattern="*.ufi"/>
|
||||||
|
<glob pattern="*.unf"/>
|
||||||
|
<glob pattern="*.unif"/>
|
||||||
|
<glob pattern="*.uze"/>
|
||||||
|
<glob pattern="*.v64"/>
|
||||||
|
<glob pattern="*.vb"/>
|
||||||
|
<glob pattern="*.vboy"/>
|
||||||
|
<glob pattern="*.vc"/>
|
||||||
|
<glob pattern="*.vec"/>
|
||||||
|
<glob pattern="*.vfl"/>
|
||||||
<glob pattern="*.voc"/>
|
<glob pattern="*.voc"/>
|
||||||
|
<glob pattern="*.vpt"/>
|
||||||
|
<glob pattern="*.vpx"/>
|
||||||
|
<glob pattern="*.vsf"/>
|
||||||
<glob pattern="*.wad"/>
|
<glob pattern="*.wad"/>
|
||||||
|
<glob pattern="*.wasm"/>
|
||||||
|
<glob pattern="*.wav"/>
|
||||||
<glob pattern="*.wbfs"/>
|
<glob pattern="*.wbfs"/>
|
||||||
|
<glob pattern="*.wia"/>
|
||||||
|
<glob pattern="*.ws"/>
|
||||||
|
<glob pattern="*.wsc"/>
|
||||||
<glob pattern="*.wua"/>
|
<glob pattern="*.wua"/>
|
||||||
|
<glob pattern="*.wud"/>
|
||||||
|
<glob pattern="*.wuhb"/>
|
||||||
|
<glob pattern="*.wux"/>
|
||||||
|
<glob pattern="*.x64"/>
|
||||||
|
<glob pattern="*.x6z"/>
|
||||||
|
<glob pattern="*.xbe"/>
|
||||||
|
<glob pattern="*.xci"/>
|
||||||
|
<glob pattern="*.xdf"/>
|
||||||
|
<glob pattern="*.xex"/>
|
||||||
|
<glob pattern="*.xfd"/>
|
||||||
|
<glob pattern="*.xsa"/>
|
||||||
|
<glob pattern="*.z"/>
|
||||||
|
<glob pattern="*.z1"/>
|
||||||
|
<glob pattern="*.z2"/>
|
||||||
|
<glob pattern="*.z3"/>
|
||||||
|
<glob pattern="*.z4"/>
|
||||||
|
<glob pattern="*.z5"/>
|
||||||
|
<glob pattern="*.z6"/>
|
||||||
|
<glob pattern="*.z64"/>
|
||||||
|
<glob pattern="*.z7"/>
|
||||||
|
<glob pattern="*.z8"/>
|
||||||
|
<glob pattern="*.z80"/>
|
||||||
|
<glob pattern="*.zar"/>
|
||||||
|
<glob pattern="*.zblorb"/>
|
||||||
<glob pattern="*.zip"/>
|
<glob pattern="*.zip"/>
|
||||||
|
<glob pattern="*.zlb"/>
|
||||||
|
<glob pattern="*.znx"/>
|
||||||
|
<glob pattern="*.zso"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
</mime-info>
|
</mime-info>
|
||||||
|
|
56
developer_toolbox/mime-populator.sh
Executable file
56
developer_toolbox/mime-populator.sh
Executable file
|
@ -0,0 +1,56 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Input files
|
||||||
|
ES_SYSTEMS_FILE="../ES-DE/resources/systems/linux/es_systems.xml"
|
||||||
|
MIME_FILE="config/retrodeck/net.retrodeck.retrodeck.mime.xml"
|
||||||
|
|
||||||
|
# List of extensions to ignore
|
||||||
|
IGNORED_EXTENSIONS=". .appimage cue"
|
||||||
|
|
||||||
|
# Check if xmlstarlet is installed
|
||||||
|
if ! command -v xmlstarlet &> /dev/null; then
|
||||||
|
echo "Error: xmlstarlet is not installed."
|
||||||
|
echo "Please install it using your package manager (e.g., sudo apt install xmlstarlet)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
EXTENSIONS_FILE=$(mktemp)
|
||||||
|
|
||||||
|
# Extract extensions from the <extension> field in es_systems.xml
|
||||||
|
grep -oP '<extension>\K.*?(?=</extension>)' "$ES_SYSTEMS_FILE" | \
|
||||||
|
tr ' ' '\n' | \
|
||||||
|
awk '{print tolower($0)}' | \
|
||||||
|
sort -u > "$EXTENSIONS_FILE"
|
||||||
|
|
||||||
|
# Create a new MIME file with the correct base structure
|
||||||
|
cat > "$MIME_FILE" << EOF
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||||
|
<mime-type type="application/retro-game">
|
||||||
|
<comment>Retro Game</comment>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Add new <glob> elements to the MIME file
|
||||||
|
while IFS= read -r ext; do
|
||||||
|
# Skip ignored extensions
|
||||||
|
if [[ "$IGNORED_EXTENSIONS" =~ (^|[[:space:]])"$ext"($|[[:space:]]) ]]; then
|
||||||
|
echo "Skipping ignored extension: $ext"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add the <glob> element for the extension
|
||||||
|
echo "Adding glob pattern for extension: $ext"
|
||||||
|
echo " <glob pattern=\"*$ext\"/>" >> "$MIME_FILE"
|
||||||
|
done < "$EXTENSIONS_FILE"
|
||||||
|
|
||||||
|
# Close the XML tags
|
||||||
|
echo " </mime-type>
|
||||||
|
</mime-info>" >> "$MIME_FILE"
|
||||||
|
|
||||||
|
# Ensure proper formatting using xmlstarlet
|
||||||
|
xmlstarlet fo --indent-tab "$MIME_FILE" > "$MIME_FILE.tmp" && mv "$MIME_FILE.tmp" "$MIME_FILE"
|
||||||
|
|
||||||
|
# Clean up temporary files
|
||||||
|
rm -f "$EXTENSIONS_FILE"
|
||||||
|
|
||||||
|
echo "MIME file updated successfully at $MIME_FILE"
|
Loading…
Reference in a new issue