utils/getdeveloperlib: add some debug information
authorVictor Huesca <victor.huesca@bootlin.com>
Sun, 4 Aug 2019 14:21:41 +0000 (16:21 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 4 Aug 2019 21:39:55 +0000 (23:39 +0200)
Signed-off-by: Victor Huesca <victor.huesca@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/getdeveloperlib.py

index 35c618f791f7938c611c03ac4c5fc9c147d8705c..81eae7ee9ba019c11526610ab23de0538f650277 100644 (file)
@@ -97,6 +97,22 @@ class Developer:
                 return True
         return False
 
+    def __repr__(self):
+        name = '\'' + self.name.split(' <')[0][:20] + '\''
+        things = []
+        if len(self.files):
+            things.append('{} files'.format(len(self.files)))
+        if len(self.packages):
+            things.append('{} pkgs'.format(len(self.packages)))
+        if len(self.architectures):
+            things.append('{} archs'.format(len(self.architectures)))
+        if len(self.infras):
+            things.append('{} infras'.format(len(self.infras)))
+        if things:
+            return 'Developer <{} ({})>'.format(name, ', '.join(things))
+        else:
+            return 'Developer <' + name + '>'
+
 
 def parse_developer_packages(fnames):
     """Given a list of file patterns, travel through the Buildroot source