no longer use dak.conf untouchable flag but that from the db.
Signed-off-by: Joerg Jaspert <joerg@debian.org>
CodeName "etch";
OverrideCodeName "etch";
Priority "5";
- Untouchable "1";
ChangeLogBase "dists/oldstable/";
UdebComponents
{
CodeName "lenny";
OverrideCodeName "lenny";
Priority "5";
- Untouchable "1";
ChangeLogBase "dists/stable/";
UdebComponents
{
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
print "Processing: " + suite
SuiteBlock = Cnf.SubTree("Suite::" + suite)
- if SuiteBlock.has_key("Untouchable"):
+ if database.get_suite_untouchable(suite)
print "Skipping: " + suite + " (untouchable)"
continue
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
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()
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:
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):