[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] untouchable



no longer use dak.conf untouchable flag but that from the db.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
 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 87e7788..c4c4954 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 1add8f5..5d6ba46 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 774e046..c6fde86 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 983c857..137c844 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 8fdde8b..7ac3ec2 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 fdf2c5e..8bb9142 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 606e8f2..7ac6f2c 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):
-- 
1.5.6.5


Reply to: