mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +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>3dobios</bios>
|
||||||
<bios>airlbios</bios>
|
<bios>airlbios</bios>
|
||||||
<bios>aleck64</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>22vp931</device>
|
||||||
<device>3c505</device>
|
<device>3c505</device>
|
||||||
<device>a1000kbd_de</device>
|
<device>a1000kbd_de</device>
|
||||||
|
|
|
@ -27,7 +27,7 @@ if [ $# -ne 1 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $1 ]; then
|
if [ ! -f $1 ]; then
|
||||||
echo "Can't find MAME driver file" $1
|
echo "Can't find MAME driver file" $1
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -36,22 +36,25 @@ MAMEBIOSFILE=mamebioses.xml
|
||||||
MAMEDEVICEFILE=mamedevices.xml
|
MAMEDEVICEFILE=mamedevices.xml
|
||||||
MAMENAMEFILE=mamenames.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
|
echo "<bios>"${bios}"</bios>" >> $MAMEBIOSFILE
|
||||||
done
|
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
|
echo "<device>"${device}"</device>" >> $MAMEDEVICEFILE
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "<!-- Generated from MAME driver file" $1 "-->" > $MAMENAMEFILE
|
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>"}' | \
|
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> "/"realname>"/g | sed '/^[[:space:]]*$/d' | \
|
||||||
sed s/"<realname"/"\t<realname"/g | sed s/"<\/realname>"/"<\/realname>\n<\/game>"/g >> $MAMENAMEFILE
|
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
|
fi
|
||||||
|
|
||||||
if [ ! -f $1 ]; then
|
if [ ! -f $1 ]; then
|
||||||
echo "Can't find old ROM index file" $1
|
echo "Can't find old ROM index file" $1
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $2 ]; then
|
if [ ! -f $2 ]; then
|
||||||
echo "Can't find new ROM index file" $1
|
echo "Can't find new ROM index file" $1
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ TEMPFILE=tempfile_$(date +%H%M%S)
|
||||||
|
|
||||||
HEADER=$(grep "<\!--" $MAME_NEW_FILE)
|
HEADER=$(grep "<\!--" $MAME_NEW_FILE)
|
||||||
|
|
||||||
grep -v "Latest updates from MAME driver file" $MAME_OLD_FILE > $TEMPFILE
|
grep -v "Last updated with information 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_NEW_FILE >> $TEMPFILE
|
||||||
echo $HEADER > $MAME_TARGET_FILE
|
echo $HEADER > $MAME_TARGET_FILE
|
||||||
sort -u $TEMPFILE | sed '/^[[:space:]]*$/d' >> $MAME_TARGET_FILE
|
sort -u $TEMPFILE | sed '/^[[:space:]]*$/d' >> $MAME_TARGET_FILE
|
||||||
rm $TEMPFILE
|
rm $TEMPFILE
|
||||||
|
|
Loading…
Reference in a new issue