33 lines
977 B
Python
33 lines
977 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from pkgcrap.util import conf_file_path
|
|
import pkgcrap.parse as parse
|
|
|
|
def packages_scan(maintainer):
|
|
repos = parse.repos()
|
|
repos.load()
|
|
packages = []
|
|
for repo in repos.repos.values():
|
|
repo.load()
|
|
print('Scanning', repo.name)
|
|
for cat in repo.categories.values():
|
|
cat.load()
|
|
for pkg in cat.packages.values():
|
|
pkg.load()
|
|
try:
|
|
if maintainer in pkg.metadata.maintainers:
|
|
packages.append(pkg)
|
|
except AttributeError:
|
|
pass
|
|
return packages
|
|
|
|
def main(args):
|
|
if len(args) < 1:
|
|
print('Specify your maintainer email address')
|
|
return
|
|
packages = packages_scan(args[0])
|
|
with open(conf_file_path('maintained.txt'), 'w') as fp:
|
|
fp.write("\n".join([pkg.full_name for pkg in packages]))
|
|
print('Updated maintained package list')
|