- originosuite_id = db_access.get_suite_id(originosuite);
- if originosuite_id == -1:
- utils.fubar("Suite '%s' not recognised." % (originosuite));
-
- component_id = db_access.get_component_id(component);
- if component_id == -1:
- utils.fubar("Component '%s' not recognised." % (component));
-
- type_id = db_access.get_override_type_id(type);
- if type_id == -1:
- utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type));
- dsc_type_id = db_access.get_override_type_id("dsc");
- deb_type_id = db_access.get_override_type_id("deb")
-
- source_priority_id = db_access.get_priority_id("source")
-
- if type == "deb" or type == "udeb":
- packages = {};
- q = projectB.query("""
+ oo = get_suite(originosuite, session)
+ if oo is None:
+ utils.fubar("Suite '%s' not recognised." % (originosuite))
+ originosuite_id = oo.suite_id
+
+ c = get_component(component, session)
+ if c is None:
+ utils.fubar("Component '%s' not recognised." % (component))
+ component_id = c.component_id
+
+ ot = get_override_type(otype, session)
+ if ot is None:
+ utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (otype))
+ type_id = ot.overridetype_id
+ dsc_type_id = get_override_type("dsc", session).overridetype_id
+
+ source_priority_id = get_priority("source", session).priority_id
+
+ if otype == "deb" or otype == "udeb":
+ packages = {}
+ # TODO: Fix to use placeholders (check how to with arrays)
+ q = session.execute("""