def rdeps_with_slot(slot_rdeps, slot=None): """ Prints a list of rev-deps which depend on the specified package and slot """ pkg_maints = {} pkg_herds = {} if not slot_rdeps.has_key(slot): # No rdeps using the given slot return print "-------------------------------" print "All packages:" print "-------------------------------" for pkg in slot_rdeps[slot]: pkg_md = MetaDataXML(get_md_path(pkg), get_herds()) for herd in pkg_md.herds(): if not pkg_herds.has_key(herd): pkg_herds[herd] = [] pkg_herds[herd].append(pkg) for maint in pkg_md.maintainers(): if not pkg_maints.has_key(maint.email): pkg_maints[maint.email] = [] pkg_maints[maint.email].append(pkg) print "\t%s\therds: " % pkg, for i in pkg_md.herds(): print "%s" % i, print "\tmaintainers: ", for i in pkg_md.maintainers(): print "%s" % i.email, print print "-------------------------------" print "Herd packages:" print "-------------------------------" for (herd, pkgs) in pkg_herds.iteritems(): print "Herd: %s" % herd for pkg in pkgs: print "\t%s" % pkg print "-------------------------------" print "Maintainer packages:" print "-------------------------------" for (maint, pkgs) in pkg_maints.iteritems(): print "Maintainer: %s" % maint for pkg in pkgs: print "\t%s" % pkg
def rdeps_with_slot(slot_rdeps, slot=None): """ Prints a list of rev-deps which depend on the specified package and slot """ pkg_maints = {} pkg_herds = {} if not slot_rdeps.has_key(slot): # No rdeps using the given slot return print "-------------------------------" print "All packages:" print "-------------------------------" for pkg in slot_rdeps[slot]: pkg_md = MetaDataXML(get_md_path(pkg), get_herds()) for herd in pkg_md.herds(): if not pkg_herds.has_key(herd): pkg_herds[herd] = [] pkg_herds[herd].append(pkg) for maint in pkg_md.maintainers(): if not pkg_maints.has_key(maint.email): pkg_maints[maint.email] = [] pkg_maints[maint.email].append(pkg) print '\t%s\therds: ' % pkg, for i in pkg_md.herds(): print '%s' % i, print '\tmaintainers: ', for i in pkg_md.maintainers(): print '%s' % i.email, print print "-------------------------------" print "Herd packages:" print "-------------------------------" for (herd, pkgs) in pkg_herds.iteritems(): print 'Herd: %s' % herd for pkg in pkgs: print '\t%s' % pkg print "-------------------------------" print "Maintainer packages:" print "-------------------------------" for (maint, pkgs) in pkg_maints.iteritems(): print 'Maintainer: %s' % maint for pkg in pkgs: print '\t%s' % pkg