1 import os, linda
2 from linda import clparser
3 from linda.debug import dprint, vprint
4 from linda.err_print import PrintErrors, ErrorPrintingException
5 from linda.libchecks import CheckRunningException
6 from linda.overrides import Overrides
7 from linda.unpack import Unpacker, UnpackException
8 from linda.parser.data import DataFileParser
9 from linda.parser.override import OverrideParser
10
13 self.mapping = {'deb': 'binary', 'dsc': 'source', 'changes': \
14 'changes', 'udeb': 'udeb'}
15 self.data_files = {}
16
32
34 self.unpack(1)
35 self.overrides.parse()
36 self.run_checks(1)
37 ext = os.path.splitext(self.file)[1][1:]
38 if linda.checks.registry[self.mapping[ext]][2]:
39 if not clparser['unpack'] or clparser['unpack'] == 2:
40 self.unpack(2)
41 if os.path.exists(os.path.join(self.unpacker.information['dir'], \
42 'debian', 'linda-overrides')):
43 try:
44 o = OverrideParser(os.path.join(self.unpacker.information['dir'], \
45 'debian', 'linda-overrides'))
46 self.overrides.merge(o)
47 except EnvironmentError, e:
48 dprint(_("Failed to parse in-tarball override: %s"))
49 self.run_checks(2)
50 self.cull_lab()
51
58
61
78
80 vprint(_("Processing file: %s") % os.path.split(self.file)[1], 1)
81 dprint(_("Processing file: %s") % os.path.split(self.file)[1])
82
85
88 self.lab = ''
89 self.information = ''
90
92 - def check(self, errs, data_files):
94