def properties(self):
return ['package', 'version', 'maintainer', 'source', 'architecture', \
'poolfile', 'binarytype', 'fingerprint', 'install_date', \
- 'suites_count', 'binary_id', 'contents_count']
+ 'suites_count', 'binary_id', 'contents_count', 'extra_sources']
def not_null_constraints(self):
return ['package', 'version', 'maintainer', 'source', 'poolfile', \
bin.source_id = bin_sources[0].source_id
+ if entry.has_key("built-using"):
+ for srcname, version in entry["built-using"]:
+ exsources = get_sources_from_name(srcname, version, session=session)
+ if len(exsources) != 1:
+ raise NoSourceFieldError, "Unable to find source package (%s = %s) in Built-Using for %s (%s), %s, file %s, type %s, signed by %s" % \
+ (srcname, version, bin.package, bin.version, entry["architecture"],
+ filename, bin.binarytype, u.pkg.changes["fingerprint"])
+
+ bin.extra_sources.append(exsources[0])
+
# Add and flush object so it has an ID
session.add(bin)
'changes_pending_files_map',
'changes_pending_source_files',
'changes_pool_files',
+ 'extra_src_references',
# TODO: the maintainer column in table override should be removed.
'override',
'suite_architectures',
fingerprint = relation(Fingerprint),
install_date = self.tbl_binaries.c.install_date,
suites = relation(Suite, secondary=self.tbl_bin_associations,
- backref=backref('binaries', lazy='dynamic'))),
+ backref=backref('binaries', lazy='dynamic')),
+ extra_sources = relation(DBSource, secondary=self.tbl_extra_src_references,
+ backref=backref('extra_binary_references', lazy='dynamic'))),
extension = validator)
mapper(BinaryACL, self.tbl_binary_acl,
if not re_valid_pkg_name.match(prov):
self.rejects.append("%s: Invalid Provides field content %s." % (f, prov))
+ # If there is a Built-Using field, we need to check we can find the
+ # exact source version
+ built_using = control.Find("Built-Using")
+ if built_using:
+ try:
+ entry["built-using"] = []
+ for dep in apt_pkg.parse_depends(built_using):
+ bu_s, bu_v, bu_e = dep[0]
+ # Check that it's an exact match dependency and we have
+ # some form of version
+ if bu_e != "=" or len(bu_v) < 1:
+ self.rejects.append("%s: Built-Using contains non strict dependency (%s %s %s)" % (f, bu_s, bu_e, bu_v))
+ else:
+ # Find the source id for this version
+ bu_so = get_sources_from_name(bu_s, version=bu_v, session = session)
+ if len(bu_so) != 1:
+ self.rejects.append("%s: Built-Using (%s = %s): Cannot find source package" % (f, bu_s, bu_v))
+ else:
+ entry["built-using"].append( (bu_so[0].source, bu_so[0].version, ) )
+
+ except ValueError, e:
+ self.rejects.append("%s: Cannot parse Built-Using field: %s" % (f, str(e)))
+
+
# Check the section & priority match those given in the .changes (non-fatal)
if control.Find("Section") and entry["section"] != "" \
and entry["section"] != control.Find("Section"):