]> git.decadent.org.uk Git - dak.git/commitdiff
untouchable
authorJoerg Jaspert <joerg@debian.org>
Fri, 13 Mar 2009 22:28:15 +0000 (23:28 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 13 Mar 2009 22:28:15 +0000 (23:28 +0100)
no longer use dak.conf untouchable flag but that from the db.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
config/debian/dak.conf
dak/control_overrides.py
dak/generate_index_diffs.py
dak/generate_releases.py
dak/make_overrides.py
dak/make_suite_file_list.py
daklib/database.py

index 87e7788083168102bf5f8c1272b2c3c4a7221b55..c4c4954277f68000eeaaf3208d9bae4b961069fb 100644 (file)
@@ -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
        {
index 1add8f5b7627060fa3d9ef2f65937f6d050ee536..5d6ba46ce6eefe33bd2b1b1ef8b8e1691bcc56c9 100755 (executable)
@@ -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
index 774e0467d99efd0673159f65378164d9d0b97048..c6fde8603cc4c8358f0dcdb078a346917be40a1a 100755 (executable)
@@ -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
 
index 983c8573f17aacde6f3a8721fb38028db3206f2a..137c84472beb08369230b444e97687ffba563366 100755 (executable)
@@ -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
 
index 8fdde8b18518d9fb8baaa9b34adeb4fb6ce01366..7ac3ec275fa6a1e04ba471bbc68927e72e6cab88 100755 (executable)
@@ -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()
 
index fdf2c5e3ea75acefe23120f54e641332229553a2..8bb9142c21c58723480c78d3504b98ae142bb31c 100755 (executable)
@@ -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:
index 606e8f2de8ba76afbe38528ac77610684252dfe6..7ac6f2cce116895e225cd2875fc89a1a7224c786 100755 (executable)
@@ -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):