]> git.decadent.org.uk Git - dak.git/blobdiff - dak/init_db.py
Revert "Merge commit 'stew/content_generation' into merge"
[dak.git] / dak / init_db.py
index 16a8d8bac7e1acfe91a1c1928a856a6b132b7a81..e1f1bced854ddcece7528db09d150c0892d759f5 100755 (executable)
@@ -21,8 +21,8 @@
 
 import pg, sys
 import apt_pkg
-import daklib.database as database
-import daklib.utils as utils
+from daklib import database
+from daklib import utils
 
 ################################################################################
 
@@ -106,11 +106,7 @@ def do_location():
             utils.fubar("Archive '%s' for location '%s' not found."
                                % (location_config["Archive"], location))
         location_type = location_config.get("type")
-        if location_type == "legacy-mixed":
-            projectB.query("INSERT INTO location (path, archive, type) VALUES "
-                           "('%s', %d, '%s')"
-                           % (location, archive_id, location_config["type"]))
-        elif location_type == "legacy" or location_type == "pool":
+        if location_type == "pool":
             for component in Cnf.SubTree("Component").List():
                 component_id = database.get_component_id(component)
                 projectB.query("INSERT INTO location (path, component, "
@@ -135,7 +131,7 @@ def do_suite():
         projectB.query("INSERT INTO suite (suite_name, version, origin, "
                        "description) VALUES ('%s', %s, %s, %s)"
                        % (suite.lower(), version, origin, description))
-        for architecture in Cnf.ValueList("Suite::%s::Architectures" % (suite)):
+        for architecture in database.get_suite_architectures(suite):
             architecture_id = database.get_architecture_id (architecture)
             if architecture_id < 0:
                 utils.fubar("architecture '%s' not found in architecture"