~sbeattie/conflictchecker/conflictchecker-fixups

« back to all changes in this revision

Viewing changes to findconflicts/__init__.py

  • Committer: Michael Vogt
  • Date: 2007-07-16 10:26:52 UTC
  • Revision ID: michael.vogt@ubuntu.com-20070716102652-i52d196wc72h1lwh
* store the preinst hash into the database when scanning new packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
import errno
9
9
import gc
 
10
import sha
10
11
import os.path
11
12
import re
12
13
import shlex
193
194
            local_file.seek(0)
194
195
            preinst = apt_inst.debExtractControl(local_file, 'preinst')
195
196
            if preinst is not None:
 
197
                info['preinst_hash'] = sha.sha(preinst).hexdigest()
196
198
                try:
197
199
                    info['diversions'] = PreinstParser().extract_diversions(preinst)
198
200
                except ParseError:
1055
1057
        name = PackageName.Ensure(info['name'], store)
1056
1058
        version = PackageVersion(
1057
1059
            name, info['version'], arch, info['controltext'])
 
1060
        if "preinst_hash" in info:
 
1061
            version.preinst_hash = info['preinst_hash']
1058
1062
        store.add(version)
1059
1063
        # we need version to have an id.
1060
1064
        store.flush()