On 06/02/2016 04:29 PM, James wrote: > > Hmmmmm. I currently have to add about 6 lines manually for each overlay > into repos.conf/overlays:: > > ... > > So your saying do this for every overlay? > > Surely there is just a way to concatenate metadata (or info) from overlays > into a single file (periodically) to perform this parse? Or am I just being > 'dense' here and not understanding what you suggest? > > I understand that what you are saying will work, but installing every > overlay to search out package listings and descriptions seems awkward; > like there ought to be a better (lightweight) way to do this? >
I didn't say it was a good idea, just that it would work =) You can script something smarter. I'm attaching a python script called maintainer.py. You can use find/xargs to search by maintainer email: $ find $REPOS/gentoo.git/ -type f -name 'metadata.xml' | \ xargs ./maintainer.py m...@gentoo.org mail-filter/pypolicyd-spf dev-ruby/rbpdf dev-ruby/spreadsheet dev-ruby/vcard dev-ruby/ruby-ole sys-process/xjobs app-laptop/hdapsd app-text/XML-Schema-learner dev-perl/Net-IPv4Addr dev-perl/Monitoring-Plugin net-dns/djbdns net-dns/rbldnsd sys-apps/apply-default-acl www-apache/mpm_itk net-mail/amavis-logwatch net-mail/mailshears net-mail/postfix-logwatch dev-lang/coffee-script dev-php/php-redmine-api dev-php/PHPMailer dev-php/recaptcha net-analyzer/nagios-check_mysql_health net-analyzer/nagios net-analyzer/monitoring-plugins net-analyzer/nagios-core net-analyzer/nagios-check_openvpn-simple net-analyzer/nagios-plugins net-analyzer/nagios-check_rbl net-misc/haeredes net-misc/hath app-backup/untangle-https-backup app-emacs/multi-term sci-mathematics/rw app-antivirus/clamav-unofficial-sigs Apparently I maintain all of those things. > And then there is the problem:: > > Package net-analyzer/wpscan-2.9.1 is missing metadata.xml > (when not installed) metadata.xml is required for every package, somebody screwed up. In any case, without it, you have no idea who the maintainer is, so you can ignore that package.
#!/usr/bin/python3 from sys import argv if len(argv) < 3: print("Usage:", argv[0], "<maintainer>", "<metadata-files>") raise SystemExit from os.path import abspath, dirname, split import xml.etree.ElementTree as ET for fileidx in range(2,len(argv)): tree = ET.parse(argv[fileidx]) root = tree.getroot() for maintainer in root.iter("maintainer"): if maintainer[0].text == argv[1]: # Found a winner. d = dirname(abspath(argv[fileidx])) (h1,t1) = split(d) (_,t2) = split(h1) print(t2 + "/" + t1)