From d7b43e596f6aba7f096d57a9e5a2cc57aa7d976b Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Thu, 28 Jul 2011 07:50:47 +0100 Subject: [PATCH] Use components from database Signed-off-by: Mark Hymers --- dak/check_archive.py | 2 +- dak/check_proposed_updates.py | 2 +- dak/cruft_report.py | 2 +- dak/override.py | 2 +- dak/override_disparity.py | 2 +- dak/rm.py | 2 +- daklib/queue.py | 3 +-- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dak/check_archive.py b/dak/check_archive.py index 0d94bbcb..1fb8560b 100755 --- a/dak/check_archive.py +++ b/dak/check_archive.py @@ -424,7 +424,7 @@ def check_indices_files_exist(): Ensure files mentioned in Packages & Sources exist """ for suite in [ "stable", "testing", "unstable" ]: - for component in Cnf.ValueList("Suite::%s::Components" % (suite)): + for component in get_component_names(): architectures = get_suite_architectures(suite) for arch in [ i.arch_string.lower() for i in architectures ]: if arch == "source": diff --git a/dak/check_proposed_updates.py b/dak/check_proposed_updates.py index eb488330..d45fd489 100755 --- a/dak/check_proposed_updates.py +++ b/dak/check_proposed_updates.py @@ -250,7 +250,7 @@ def parse_packages(): # Parse the Packages files (since it's a sub-second operation on auric) suite = "stable" stable = {} - components = cnf.ValueList("Suite::%s::Components" % (suite)) + components = get_component_names() architectures = [ a.arch_string for a in get_suite_architectures(suite, skipsrc=True, skipall=True) ] for component in components: for architecture in architectures: diff --git a/dak/cruft_report.py b/dak/cruft_report.py index 21988dcd..5b199dca 100755 --- a/dak/cruft_report.py +++ b/dak/cruft_report.py @@ -571,7 +571,7 @@ def main (): bins_in_suite = get_suite_binaries(suite, session) # Checks based on the Sources files - components = cnf.ValueList("Suite::%s::Components" % (suite_name)) + components = get_component_names(session) for component in components: filename = "%s/dists/%s/%s/source/Sources.gz" % (cnf["Dir::Root"], suite_name, component) # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... diff --git a/dak/override.py b/dak/override.py index e6d47db2..de888e55 100755 --- a/dak/override.py +++ b/dak/override.py @@ -61,7 +61,7 @@ def check_override_compliance(package, priority, suite, cnf, session): depends = set() rdepends = set() - components = cnf.ValueList("Suite::%s::Components" % suite) + components = get_component_names(session) arches = set([x.arch_string for x in get_suite_architectures(suite)]) arches -= set(["source", "all"]) for arch in arches: diff --git a/dak/override_disparity.py b/dak/override_disparity.py index b0218517..3ec6ff1f 100755 --- a/dak/override_disparity.py +++ b/dak/override_disparity.py @@ -82,7 +82,7 @@ def main(): depends = {} session = DBConn().session() suite = Options['suite'] - components = cnf.ValueList('Suite::%s::Components' % suite) + components = get_component_names(session) arches = set([x.arch_string for x in get_suite_architectures(suite)]) arches -= set(['source', 'all']) for arch in arches: diff --git a/dak/rm.py b/dak/rm.py index 944a46e6..e0a5fa79 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -102,7 +102,7 @@ def reverse_depends_check(removals, suites, arches=None): cnf = Config() print "Checking reverse dependencies..." - components = cnf.ValueList("Suite::%s::Components" % suites[0]) + components = get_component_names() dep_problem = 0 p2c = {} all_broken = {} diff --git a/daklib/queue.py b/daklib/queue.py index c7785ade..41654719 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -961,8 +961,7 @@ class Upload(object): entry["component"] = dest # Ensure the component is valid for the target suite - if cnf.has_key("Suite:%s::Components" % (suite)) and \ - entry["component"] not in cnf.ValueList("Suite::%s::Components" % (suite)): + if entry["component"] not in get_component_names(session): self.rejects.append("unknown component `%s' for suite `%s'." % (entry["component"], suite)) return -- 2.39.5