45 lines
980 B
Python
Executable File
45 lines
980 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
|
|
"""
|
|
Original author: XGQT
|
|
Licensed under the ISC License
|
|
Copyright (c) 2020, src_prepare group
|
|
|
|
How to use:
|
|
- cd into the repository root:
|
|
$ pwd
|
|
=> /home/user/git/src_prepare-overlay/app-admin/
|
|
cd ..
|
|
- run this script
|
|
"""
|
|
|
|
|
|
import os
|
|
import os.path
|
|
import xml.etree.ElementTree as ET
|
|
|
|
|
|
METADATAS = [
|
|
os.path.join(dp, f)
|
|
for dp, _, filenames in os.walk(".")
|
|
for f in filenames if os.path.splitext(f)[1] == '.xml'
|
|
]
|
|
|
|
|
|
if __name__ == '__main__':
|
|
for metadata in METADATAS:
|
|
try:
|
|
_, cat, pkg, _ = metadata.split("/")
|
|
print("Package: %s/%s" % (cat, pkg))
|
|
maints = []
|
|
with open(metadata) as m:
|
|
tree = ET.parse(m)
|
|
root = tree.getroot()
|
|
for item in root.findall('./maintainer'):
|
|
for child in item:
|
|
print(4 * " ", child.tag, ":", child.text)
|
|
|
|
except ValueError:
|
|
continue
|