- if override.type == 7:
- s.execute( """INSERT INTO deb_contents (file,section,package,binary_id,arch,suite,component)
- VALUES (:filename, :section, :package, :binary_id, :arch, :suite, :component);""",
- { 'filename' : filename,
- 'section' : override.section,
- 'package' : override.package,
- 'binary_id' : binary.binary_id,
- 'arch' : binary.arch,
- 'suite' : override.suite,
- 'component' : override.component } )
-
-
- elif override.type == 9:
- s.execute( """INSERT INTO deb_contents (file,section,package,binary_id,arch,suite,component)
- VALUES (:filename, :section, :package, :binary_id, :arch, :suite, :component);""",
- { 'filename' : filename,
- 'section' : override.section,
- 'package' : override.package,
- 'binary_id' : binary.binary_id,
- 'arch' : binary.arch,
- 'suite' : override.suite,
- 'component' : override.component } )
-
-# def bootstrap(self):
-# """
-# scan the existing debs in the pool to populate the contents database tables
-# """
-# pooldir = Config()[ 'Dir::Pool' ]
-
-# s = DBConn().session()
-
-# for suite in s.query(Suite).all():
-# for arch in get_suite_architectures(suite.suite_name, skipsrc=True, skipall=True, session=s):
-# q = s.query(BinAssociation).join(Suite)
-# q = q.join(Suite).filter_by(suite_name=suite.suite_name)
-# q = q.join(DBBinary).join(Architecture).filter_by(arch.arch_string)
-# for ba in q:
-# filename = ba.binary.poolfile.filename
-# # Check for existing contents
-# existingq = s.query(ContentAssociations).filter_by(binary_pkg=ba.binary_id).limit(1)
-# if existingq.count() > 0:
-# log.debug( "already imported: %s" % (filename))
-# else:
-# # We don't have existing contents so import them
-# log.debug( "scanning: %s" % (filename) )
-# debfile = os.path.join(pooldir, filename)
-# if os.path.exists(debfile):
-# Binary(debfile, self.reject).scan_package(ba.binary_id, True)
-# else:
-# log.error("missing .deb: %s" % filename)
+ if exists.fetchone():
+ print '.',
+ continue
+ else:
+ print '+',
+
+ s.execute( """INSERT INTO %s_contents (filename,section,package,binary_id,arch,suite)
+ SELECT file, :section, :package, :binary_id, :arch, :suite
+ FROM bin_contents
+ WHERE binary_id=:binary_id;""" % override_type_map[override.overridetype_id],
+ { 'section' : override.section_id,
+ 'package' : override.package,
+ 'binary_id' : binary.id,
+ 'arch' : binary.architecture,
+ 'suite' : override.suite_id } )
+ s.commit()
+