From 28034de51f4a896773545e90041476aba700efbf Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Fri, 13 Mar 2009 23:28:15 +0100 Subject: [PATCH] untouchable no longer use dak.conf untouchable flag but that from the db. Signed-off-by: Joerg Jaspert --- config/debian/dak.conf | 2 -- dak/control_overrides.py | 2 +- dak/generate_index_diffs.py | 2 +- dak/generate_releases.py | 2 +- dak/make_overrides.py | 2 +- dak/make_suite_file_list.py | 2 +- daklib/database.py | 27 +++++++++++++++++++++++++++ 7 files changed, 32 insertions(+), 7 deletions(-) diff --git a/config/debian/dak.conf b/config/debian/dak.conf index 87e77880..c4c49542 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -214,7 +214,6 @@ Suite CodeName "etch"; OverrideCodeName "etch"; Priority "5"; - Untouchable "1"; ChangeLogBase "dists/oldstable/"; UdebComponents { @@ -282,7 +281,6 @@ Suite CodeName "lenny"; OverrideCodeName "lenny"; Priority "5"; - Untouchable "1"; ChangeLogBase "dists/stable/"; UdebComponents { diff --git a/dak/control_overrides.py b/dak/control_overrides.py index 1add8f5b..5d6ba46c 100755 --- a/dak/control_overrides.py +++ b/dak/control_overrides.py @@ -297,7 +297,7 @@ def main (): if action == "list": list_overrides(suite, component, otype) else: - if Cnf.has_key("Suite::%s::Untouchable" % suite) and Cnf["Suite::%s::Untouchable" % suite] != 0: + if database.get_suite_untouchable(suite): utils.fubar("%s: suite is untouchable" % suite) noaction = 0 diff --git a/dak/generate_index_diffs.py b/dak/generate_index_diffs.py index 774e0467..c6fde860 100755 --- a/dak/generate_index_diffs.py +++ b/dak/generate_index_diffs.py @@ -321,7 +321,7 @@ def main(): print "Processing: " + suite SuiteBlock = Cnf.SubTree("Suite::" + suite) - if SuiteBlock.has_key("Untouchable"): + if database.get_suite_untouchable(suite) print "Skipping: " + suite + " (untouchable)" continue diff --git a/dak/generate_releases.py b/dak/generate_releases.py index 983c8573..137c8447 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -159,7 +159,7 @@ def main (): print "Processing: " + suite SuiteBlock = Cnf.SubTree("Suite::" + suite) - if SuiteBlock.has_key("Untouchable") and not Options["Force-Touch"]: + if database.get_suite_untouchable(suite) and not Options["Force-Touch"]: print "Skipping: " + suite + " (untouchable)" continue diff --git a/dak/make_overrides.py b/dak/make_overrides.py index 8fdde8b1..7ac3ec27 100755 --- a/dak/make_overrides.py +++ b/dak/make_overrides.py @@ -118,7 +118,7 @@ def main (): database.init(Cnf, projectB) for suite in Cnf.SubTree("Check-Overrides::OverrideSuites").List(): - if Cnf.has_key("Suite::%s::Untouchable" % suite) and Cnf["Suite::%s::Untouchable" % suite] != 0: + if database.get_suite_untouchable(suite): continue suite = suite.lower() diff --git a/dak/make_suite_file_list.py b/dak/make_suite_file_list.py index fdf2c5e3..8bb9142c 100755 --- a/dak/make_suite_file_list.py +++ b/dak/make_suite_file_list.py @@ -91,7 +91,7 @@ def delete_packages(delete_versions, pkg, dominant_arch, suite, delete_version = version[0] delete_id = packages[delete_unique_id]["sourceid"] delete_arch = packages[delete_unique_id]["arch"] - if not Cnf.Find("Suite::%s::Untouchable" % (suite)) or Options["Force"]: + if not database.get_suite_untouchable(suite) or Options["Force"]: if Options["No-Delete"]: print "Would delete %s_%s_%s in %s in favour of %s_%s" % (pkg, delete_arch, delete_version, suite, dominant_version, dominant_arch) else: diff --git a/daklib/database.py b/daklib/database.py index 606e8f2d..7ac6f2cc 100755 --- a/daklib/database.py +++ b/daklib/database.py @@ -486,6 +486,33 @@ def get_suite_architectures(suite): q = projectB.query(sql) return map(lambda x: x[0], q.getresult()) +def get_suite_untouchable(suite): + """ + Returns true if the C{suite} is untouchable, otherwise false. + + @type suite: string, int + @param suite: the suite name or the suite_id + + @rtype: boolean + @return: status of suite + """ + + suite_id = None + if type(suite) == str: + suite_id = get_suite_id(suite) + elif type(suite) == int: + suite_id = suite + else: + return None + + sql = """ SELECT untouchable FROM suite WHERE id='%s' """ % (suite_id) + + q = projectB.query(sql) + if q.getresult()[0][0] == "f": + return False + else: + return True + ################################################################################ def get_or_set_maintainer_id (maintainer): -- 2.39.5