| 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) |
| 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 |
| 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): |
| 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])) |