mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Some small changes to the MAME index files generation scripts.
This commit is contained in:
parent
558dcb6962
commit
ac0e69fbab
|
@ -1,4 +1,4 @@
|
|||
<!-- Latest updates from MAME driver file mame0221.xml -->
|
||||
<!-- Last updated with information from MAME driver file mame0221.xml -->
|
||||
<bios>3dobios</bios>
|
||||
<bios>airlbios</bios>
|
||||
<bios>aleck64</bios>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- Latest updates from MAME driver file mame0221.xml -->
|
||||
<!-- Last updated with information from MAME driver file mame0221.xml -->
|
||||
<device>22vp931</device>
|
||||
<device>3c505</device>
|
||||
<device>a1000kbd_de</device>
|
||||
|
|
|
@ -27,7 +27,7 @@ if [ $# -ne 1 ]; then
|
|||
fi
|
||||
|
||||
if [ ! -f $1 ]; then
|
||||
echo "Can't find MAME driver file" $1
|
||||
echo "Can't find MAME driver file" $1
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -36,22 +36,25 @@ MAMEBIOSFILE=mamebioses.xml
|
|||
MAMEDEVICEFILE=mamedevices.xml
|
||||
MAMENAMEFILE=mamenames.xml
|
||||
|
||||
echo "<!-- Latest updates from MAME driver file" $1 "-->" > $MAMEBIOSFILE
|
||||
echo "<!-- Last updated with information from MAME driver file" $1 "-->" > $MAMEBIOSFILE
|
||||
|
||||
for bios in $(xmlstarlet sel -t -m "/mame/machine[@isbios=\"yes\"]" -v "@name" -n $MAME_XML_FILE); do
|
||||
for bios in $(xmlstarlet sel -t -m "/mame/machine[@isbios=\"yes\"]" -v "@name" \
|
||||
-n $MAME_XML_FILE); do
|
||||
echo "<bios>"${bios}"</bios>" >> $MAMEBIOSFILE
|
||||
done
|
||||
|
||||
echo "<!-- Latest updates from MAME driver file" $1 "-->" > $MAMEDEVICEFILE
|
||||
echo "<!-- Last updated with information from MAME driver file" $1 "-->" > $MAMEDEVICEFILE
|
||||
|
||||
for device in $(xmlstarlet sel -t -m "/mame/machine[@isdevice=\"yes\"][rom]" -v "@name" -n $MAME_XML_FILE); do
|
||||
for device in $(xmlstarlet sel -t -m "/mame/machine[@isdevice=\"yes\"][rom]" \
|
||||
-v "@name" -n $MAME_XML_FILE); do
|
||||
echo "<device>"${device}"</device>" >> $MAMEDEVICEFILE
|
||||
done
|
||||
|
||||
echo "<!-- Generated from MAME driver file" $1 "-->" > $MAMENAMEFILE
|
||||
|
||||
xmlstarlet sel -t -m "/mame/machine[not(@isbios=\"yes\")][not(@isdevice=\"yes\")][rom]" -v "@name" -o " " -v description -n $MAME_XML_FILE | \
|
||||
xmlstarlet sel -t -m "/mame/machine[not(@isbios=\"yes\")][not(@isdevice=\"yes\")][rom]" \
|
||||
-v "@name" -o " " -v description -n $MAME_XML_FILE | \
|
||||
awk '{ print "<mamename>" $1 "</mamename>"; print $1=""; print "<realname>" $0 "</realname>"}' | \
|
||||
sed s/"realname> "/"realname>"/g | sed '/^[[:space:]]*$/d' | sed s/"<mamename"/"<game>\n\t<mamename"/g | \
|
||||
sed s/"<realname"/"\t<realname"/g | sed s/"<\/realname>"/"<\/realname>\n<\/game>"/g >> $MAMENAMEFILE
|
||||
|
||||
sed s/"realname> "/"realname>"/g | sed '/^[[:space:]]*$/d' | \
|
||||
sed s/"<mamename"/"<game>\n\t<mamename"/g | sed s/"<realname"/"\t<realname"/g |
|
||||
sed s/"<\/realname>"/"<\/realname>\n<\/game>"/g >> $MAMENAMEFILE
|
||||
|
|
|
@ -25,12 +25,12 @@ if [ $# -ne 3 ]; then
|
|||
fi
|
||||
|
||||
if [ ! -f $1 ]; then
|
||||
echo "Can't find old ROM index file" $1
|
||||
echo "Can't find old ROM index file" $1
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f $2 ]; then
|
||||
echo "Can't find new ROM index file" $1
|
||||
echo "Can't find new ROM index file" $1
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -41,8 +41,8 @@ TEMPFILE=tempfile_$(date +%H%M%S)
|
|||
|
||||
HEADER=$(grep "<\!--" $MAME_NEW_FILE)
|
||||
|
||||
grep -v "Latest updates from MAME driver file" $MAME_OLD_FILE > $TEMPFILE
|
||||
grep -v "Latest updates from MAME driver file" $MAME_NEW_FILE >> $TEMPFILE
|
||||
grep -v "Last updated with information from MAME driver file" $MAME_OLD_FILE > $TEMPFILE
|
||||
grep -v "Last updated with information from MAME driver file" $MAME_NEW_FILE >> $TEMPFILE
|
||||
echo $HEADER > $MAME_TARGET_FILE
|
||||
sort -u $TEMPFILE | sed '/^[[:space:]]*$/d' >> $MAME_TARGET_FILE
|
||||
rm $TEMPFILE
|
||||
|
|
Loading…
Reference in a new issue