/[collab-qa]/udd/udd/packages_gatherer.py
ViewVC logotype

Diff of /udd/udd/packages_gatherer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1367 by lucas, Sun Dec 21 22:31:40 2008 UTC revision 1368 by lucas, Thu Dec 25 08:19:52 2008 UTC
# Line 11  import tempfile Line 11  import tempfile
11  from aux import ConfigException  from aux import ConfigException
12  import psycopg2  import psycopg2
13  from gatherer import gatherer  from gatherer import gatherer
14    import re
15    
16  def get_gatherer(connection, config, source):  def get_gatherer(connection, config, source):
17    return packages_gatherer(connection, config, source)    return packages_gatherer(connection, config, source)
# Line 30  class packages_gatherer(gatherer): Line 31  class packages_gatherer(gatherer):
31        'SHA1':0, 'Replaces':0, 'Section':0, 'MD5sum':0, 'Bugs':0, 'Priority':0,        'SHA1':0, 'Replaces':0, 'Section':0, 'MD5sum':0, 'Bugs':0, 'Priority':0,
32        'Tag':0, 'Task':0, 'Python-Version':0, 'Provides':0, 'Conflicts':0,        'Tag':0, 'Task':0, 'Python-Version':0, 'Provides':0, 'Conflicts':0,
33        'SHA256':0, 'Original-Maintainer':0}        'SHA256':0, 'Original-Maintainer':0}
34    ignorable = {'Filename':0, 'Npp-Name':0, 'Npp-Mimetype':0, 'Npp-Applications':0, 'Python-Runtime':0, 'Npp-File':0, 'Npp-Description':0, 'Url':0, 'Gstreamer-Elements':0, 'Gstreamer-Version':0, 'Gstreamer-Decoders':0, 'Gstreamer-Uri-Sinks':0, 'Gstreamer-Encoders':0, 'Gstreamer-Uri-Sources':0 }    ignorable = {'Filename':0, 'Npp-Name':0, 'Npp-Mimetype':0, 'Npp-Applications':0, 'Python-Runtime':0, 'Npp-File':0, 'Npp-Description':0, 'Url':0, 'Gstreamer-Elements':0, 'Gstreamer-Version':0, 'Gstreamer-Decoders':0, 'Gstreamer-Uri-Sinks':0, 'Gstreamer-Encoders':0, 'Gstreamer-Uri-Sources':0, 'url':0, 'Vdr-PatchLevel':0, 'originalmaintainer':0 }
35      ignorable_re = re.compile("^(Original-|Origianl-|Debian-|X-Original-|Upstream-)")
36    
37    warned_about = {}    warned_about = {}
38    # A mapping from <package-name><version> to 1 If <package-name><version> is    # A mapping from <package-name><version> to 1 If <package-name><version> is
# Line 62  class packages_gatherer(gatherer): Line 64  class packages_gatherer(gatherer):
64          d[k] = control[k]          d[k] = control[k]
65      for k in control.keys():      for k in control.keys():
66        if k not in packages_gatherer.non_mandatory and k not in packages_gatherer.mandatory and k not in packages_gatherer.ignorable:        if k not in packages_gatherer.non_mandatory and k not in packages_gatherer.mandatory and k not in packages_gatherer.ignorable:
67          if k not in packages_gatherer.warned_about:          if not packages_gatherer.ignorable_re.match(k):
68            packages_gatherer.warned_about[k] = 1            if k not in packages_gatherer.warned_about:
69          else:              packages_gatherer.warned_about[k] = 1
70            packages_gatherer.warned_about[k] += 1            else:
71                packages_gatherer.warned_about[k] += 1
72      return d      return d
73    
74    def import_packages(self, sequence, cur):    def import_packages(self, sequence, cur):
# Line 199  class packages_gatherer(gatherer): Line 202  class packages_gatherer(gatherer):
202    
203    def print_warnings(self):    def print_warnings(self):
204      for key in packages_gatherer.warned_about:      for key in packages_gatherer.warned_about:
205        print("Unknown key: %s appeared %d times" % (key, packages_gatherer.warned_about[key]))        print("[Packages] Unknown key %s appeared %d times" % (key, packages_gatherer.warned_about[key]))

Legend:
Removed from v.1367  
changed lines
  Added in v.1368

  ViewVC Help
Powered by ViewVC 1.1.5