X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fimport_archive.py;h=028239b0d4b3b374107ab52550e40e3ce1a02237;hb=b43ed3ff3738940ce46caa836d88b6937a76582c;hp=d87d6ca9e3fd98e638620807aed50be1929cbdb3;hpb=0d80b258098ff470433efa4d9c1f81b404883195;p=dak.git diff --git a/dak/import_archive.py b/dak/import_archive.py index d87d6ca9..028239b0 100755 --- a/dak/import_archive.py +++ b/dak/import_archive.py @@ -233,13 +233,10 @@ def update_locations (): SubSec = Cnf.SubTree("Location::%s" % (location)) archive_id = database.get_archive_id(SubSec["archive"]) type = SubSec.Find("type") - if type == "legacy-mixed": - projectB.query("INSERT INTO location (path, archive, type) VALUES ('%s', %d, '%s')" % (location, archive_id, SubSec["type"])) - else: - for component in Cnf.SubTree("Component").List(): - component_id = database.get_component_id(component) - projectB.query("INSERT INTO location (path, component, archive, type) VALUES ('%s', %d, %d, '%s')" % - (location, component_id, archive_id, SubSec["type"])) + for component in Cnf.SubTree("Component").List(): + component_id = database.get_component_id(component) + projectB.query("INSERT INTO location (path, component, archive, type) VALUES ('%s', %d, %d, '%s')" % + (location, component_id, archive_id, SubSec["type"])) def update_architectures (): projectB.query("DELETE FROM architecture") @@ -254,7 +251,7 @@ def update_suites (): for i in ("Version", "Origin", "Description"): if SubSec.has_key(i): projectB.query("UPDATE suite SET %s = '%s' WHERE suite_name = '%s'" % (i.lower(), SubSec[i], suite.lower())) - for architecture in Cnf.ValueList("Suite::%s::Architectures" % (suite)): + for architecture in database.get_suite_architectures(suite): architecture_id = database.get_architecture_id (architecture) projectB.query("INSERT INTO suite_architectures (suite, architecture) VALUES (currval('suite_id_seq'), %d)" % (architecture_id)) @@ -542,11 +539,7 @@ Please read the documentation before running this script. SubSec = Cnf.SubTree("Location::%s" % (location)) server = SubSec["Archive"] type = Cnf.Find("Location::%s::Type" % (location)) - if type == "legacy-mixed": - sources = location + 'Sources.gz' - suite = Cnf.Find("Location::%s::Suite" % (location)) - do_sources(sources, suite, "", server) - elif type == "legacy" or type == "pool": + if type == "pool": for suite in Cnf.ValueList("Location::%s::Suites" % (location)): for component in Cnf.SubTree("Component").List(): sources = Cnf["Dir::Root"] + "dists/" + Cnf["Suite::%s::CodeName" % (suite)] + '/' + component + '/source/' + 'Sources.gz' @@ -560,18 +553,12 @@ Please read the documentation before running this script. SubSec = Cnf.SubTree("Location::%s" % (location)) server = SubSec["Archive"] type = Cnf.Find("Location::%s::Type" % (location)) - if type == "legacy-mixed": - packages = location + 'Packages' - suite = Cnf.Find("Location::%s::Suite" % (location)) - print 'Processing '+location+'...' - process_packages (packages, suite, "", server) - elif type == "legacy" or type == "pool": + if type == "pool": for suite in Cnf.ValueList("Location::%s::Suites" % (location)): udeb_components = map(lambda x: x+"/debian-installer", Cnf.ValueList("Suite::%s::UdebComponents" % suite)) for component in Cnf.SubTree("Component").List() + udeb_components: - architectures = filter(utils.real_arch, - Cnf.ValueList("Suite::%s::Architectures" % (suite))) + architectures = filter(utils.real_arch, database.get_suite_architectures(suite)) for architecture in architectures: packages = Cnf["Dir::Root"] + "dists/" + Cnf["Suite::%s::CodeName" % (suite)] + '/' + component + '/binary-' + architecture + '/Packages' print 'Processing '+packages+'...'