scripts/src/maintainers

59 lines
1.5 KiB
Python
Executable File

#!/usr/bin/env python
"""
This file is part of scripts.
scripts is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
scripts is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with scripts. If not, see <https://www.gnu.org/licenses/>.
Original author: Maciej Barć <xgqt@riseup.net>
Copyright (c) 2020, src_prepare group
Licensed under the GNU GPL v3 License
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