commit:     0b07d8e0ad219985d17dafd3a71cb7eb44bd0e20
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 22 17:08:11 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 22 17:08:11 2017 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=0b07d8e0

packages-inheriting-eclasses: Include unused eclasses

 packages-inheriting-eclasses.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/packages-inheriting-eclasses.py b/packages-inheriting-eclasses.py
index 082af8d..35ec59e 100755
--- a/packages-inheriting-eclasses.py
+++ b/packages-inheriting-eclasses.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import collections, datetime, os, os.path, sys
+import datetime, os, os.path, sys
 import pkgcore.config # tested with pkgcore-0.9.2
 
 def main(argv):
@@ -13,7 +13,11 @@ def main(argv):
        c = pkgcore.config.load_config()
        portdir = c.repo['gentoo']
 
-       output = collections.defaultdict(set)
+       output = {}
+       # initiate with all eclasses
+       # (this also ensures we know eclasses that have no packages)
+       for k in portdir.eclass_cache.eclasses:
+               output[k] = set()
 
        for p in portdir:
                for eclass in p.data.get('_eclasses_', ()):

Reply via email to