mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
Merge pull request #1449 from MilhouseVH/cleanup_fixes
buildystem: Cleanup fixes
This commit is contained in:
commit
a3b0cb501a
@ -298,22 +298,22 @@ post_makeinstall_target() {
|
|||||||
mkdir -p $INSTALL/usr/share/kodi/system/settings
|
mkdir -p $INSTALL/usr/share/kodi/system/settings
|
||||||
|
|
||||||
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/guisettings.xml \
|
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/guisettings.xml \
|
||||||
$PROJECT_DIR/$PROJECT/kodi/guisettings.xml
|
$PROJECT_DIR/$PROJECT/kodi/guisettings.xml \
|
||||||
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/guisettings.xml \
|
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/guisettings.xml \
|
||||||
> $INSTALL/usr/share/kodi/config/guisettings.xml
|
> $INSTALL/usr/share/kodi/config/guisettings.xml
|
||||||
|
|
||||||
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/sources.xml \
|
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/sources.xml \
|
||||||
$PROJECT_DIR/$PROJECT/kodi/sources.xml
|
$PROJECT_DIR/$PROJECT/kodi/sources.xml \
|
||||||
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/sources.xml \
|
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/sources.xml \
|
||||||
> $INSTALL/usr/share/kodi/config/sources.xml
|
> $INSTALL/usr/share/kodi/config/sources.xml
|
||||||
|
|
||||||
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/advancedsettings.xml \
|
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/advancedsettings.xml \
|
||||||
$PROJECT_DIR/$PROJECT/kodi/advancedsettings.xml
|
$PROJECT_DIR/$PROJECT/kodi/advancedsettings.xml \
|
||||||
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/advancedsettings.xml \
|
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/advancedsettings.xml \
|
||||||
> $INSTALL/usr/share/kodi/system/advancedsettings.xml
|
> $INSTALL/usr/share/kodi/system/advancedsettings.xml
|
||||||
|
|
||||||
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/appliance.xml \
|
$PKG_DIR/scripts/xml_merge.py $PKG_DIR/config/appliance.xml \
|
||||||
$PROJECT_DIR/$PROJECT/kodi/appliance.xml
|
$PROJECT_DIR/$PROJECT/kodi/appliance.xml \
|
||||||
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/appliance.xml \
|
$PROJECT_DIR/$PROJECT/devices/$DEVICE/kodi/appliance.xml \
|
||||||
> $INSTALL/usr/share/kodi/system/settings/appliance.xml
|
> $INSTALL/usr/share/kodi/system/settings/appliance.xml
|
||||||
|
|
||||||
|
@ -2,15 +2,25 @@
|
|||||||
|
|
||||||
# taken from http://stackoverflow.com/a/14879370 with minor modifications
|
# taken from http://stackoverflow.com/a/14879370 with minor modifications
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
from xml.etree import ElementTree as et
|
from xml.etree import ElementTree as et
|
||||||
|
|
||||||
|
def printerr(*args, **kwargs):
|
||||||
|
print(*args, file=sys.stderr, **kwargs)
|
||||||
|
|
||||||
class XMLCombiner(object):
|
class XMLCombiner(object):
|
||||||
def __init__(self, filenames):
|
def __init__(self, filenames):
|
||||||
assert len(filenames) > 0, 'No filenames!'
|
if len(filenames) == 0:
|
||||||
self.roots = [et.parse(f).getroot() for f in filenames]
|
raise Exception('No filenames!')
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.roots = [et.parse(f).getroot() for f in filenames]
|
||||||
|
except xml.etree.ElementTree.ParseError:
|
||||||
|
printerr("ERROR: Unable to parse XML file %s" % f)
|
||||||
|
raise
|
||||||
|
|
||||||
def prettyPrint(self, etree_xml):
|
def prettyPrint(self, etree_xml):
|
||||||
minidom = xml.dom.minidom.parseString(et.tostring(etree_xml))
|
minidom = xml.dom.minidom.parseString(et.tostring(etree_xml))
|
||||||
@ -38,14 +48,8 @@ class XMLCombiner(object):
|
|||||||
one.append(el)
|
one.append(el)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
xmlfiles = [file for file in sys.argv[1:] if os.path.exists(file)]
|
||||||
r = XMLCombiner([sys.argv[1], sys.argv[2], sys.argv[3]]).combine()
|
|
||||||
except IOError:
|
r = XMLCombiner(xmlfiles).combine()
|
||||||
try:
|
|
||||||
r = XMLCombiner([sys.argv[1], sys.argv[2]]).combine()
|
|
||||||
except IOError:
|
|
||||||
try:
|
|
||||||
r = XMLCombiner([sys.argv[1], sys.argv[3]]).combine()
|
|
||||||
except IOError:
|
|
||||||
r = XMLCombiner([sys.argv[1]]).combine()
|
|
||||||
print(r)
|
print(r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user