)
stage $GO
-ulimit -m 90000 -d 90000 -s 10000 -v 200000
-
GO=(
FUNC="runparts"
TIME="run-parts"
CodeName "etch";
OverrideCodeName "etch";
Priority "5";
- Untouchable "1";
ChangeLogBase "dists/oldstable/";
UdebComponents
{
CodeName "lenny";
OverrideCodeName "lenny";
Priority "5";
- Untouchable "1";
ChangeLogBase "dists/stable/";
UdebComponents
{
cursor1.execute( "EXECUTE olddeb_q(%d)" % (deb[0] ) )
old = cursor1.fetchone()
if old:
- log.debug( "already imported: %s" % deb[1] )
+ log.debug( "already imported: %s" % (deb[1]) )
else:
+ log.debug( "scanning: %s" % (deb[1]) )
debfile = os.path.join( pooldir, deb[1] )
if os.path.exists( debfile ):
Binary(debfile, self.reject).scan_package( deb[0] )
'cruft' : Contents.cruft,
}
+ args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv)
+
+ if (len(args) < 1) or not commands.has_key(args[0]):
+ usage()
+
+ if cnf.has_key("%s::%s" % (options_prefix,"Help")):
+ usage()
+
level=logging.INFO
if cnf.has_key("%s::%s" % (options_prefix,"Quiet")):
level=logging.ERROR
format='%(asctime)s %(levelname)s %(message)s',
stream = sys.stderr )
- args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv)
-
- if (len(args) < 1) or not commands.has_key(args[0]):
- usage()
-
- if cnf.has_key("%s::%s" % (options_prefix,"Help")):
- usage()
-
commands[args[0]](Contents())
if __name__ == '__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
--- /dev/null
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Debian Archive Kit Database Update Script
+Copyright © 2008 Michael Casadevall <mcasadevall@debian.org>
+Copyright © 2009 Joerg Jaspert <joerg@debian.org>
+
+Debian Archive Kit Database Update Script 7
+"""
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+# * Ganneff ponders how to best write the text to -devel. (need to tell em in
+# case they find more bugs). "We fixed the fucking idiotic broken implementation
+# to be less so" is probably not the nicest, even if perfect valid, way to say so
+
+################################################################################
+
+import psycopg2
+import time
+from daklib.dak_exceptions import DBUpdateError
+from daklib.utils import get_conf
+
+################################################################################
+
+def do_update(self):
+ print "Moving some of the suite config into the DB"
+ Cnf = get_conf()
+
+ try:
+ c = self.db.cursor()
+
+ c.execute("ALTER TABLE suite ADD COLUMN untouchable BOOLEAN NOT NULL DEFAULT FALSE;")
+ query = "UPDATE suite SET untouchable = TRUE WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ untouchable = Cnf.Find("Suite::%s::Untouchable" % (suite))
+ if not untouchable:
+ continue
+ print "[Untouchable] Processing suite %s" % (suite)
+ suite = suite.lower()
+ c.execute(query, [suite])
+
+
+ c.execute("ALTER TABLE suite ADD COLUMN announce text NOT NULL DEFAULT 'debian-devel-changes@lists.debian.org';")
+ query = "UPDATE suite SET announce = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ announce_list = Cnf.Find("Suite::%s::Announce" % (suite))
+ print "[Announce] Processing suite %s" % (suite)
+ suite = suite.lower()
+ c.execute(query, [announce_list, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN codename text;")
+ query = "UPDATE suite SET codename = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ codename = Cnf.Find("Suite::%s::CodeName" % (suite))
+ print "[Codename] Processing suite %s" % (suite)
+ suite = suite.lower()
+ c.execute(query, [codename, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN overridecodename text;")
+ query = "UPDATE suite SET overridecodename = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ codename = Cnf.Find("Suite::%s::OverrideCodeName" % (suite))
+ print "[OverrideCodeName] Processing suite %s" % (suite)
+ suite = suite.lower()
+ c.execute(query, [codename, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN validtime integer NOT NULL DEFAULT 604800;")
+ query = "UPDATE suite SET validtime = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ validtime = Cnf.Find("Suite::%s::ValidTime" % (suite))
+ print "[ValidTime] Processing suite %s" % (suite)
+ if not validtime:
+ validtime = 0
+ suite = suite.lower()
+ c.execute(query, [validtime, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN priority integer NOT NULL DEFAULT 0;")
+ query = "UPDATE suite SET priority = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ priority = Cnf.Find("Suite::%s::Priority" % (suite))
+ print "[Priority] Processing suite %s" % (suite)
+ if not priority:
+ priority = 0
+ suite = suite.lower()
+ c.execute(query, [priority, suite])
+
+
+ c.execute("ALTER TABLE suite ADD COLUMN notautomatic BOOLEAN NOT NULL DEFAULT FALSE;")
+ query = "UPDATE suite SET notautomatic = TRUE WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ notautomatic = Cnf.Find("Suite::%s::NotAutomatic" % (suite))
+ print "[NotAutomatic] Processing suite %s" % (suite)
+ if not notautomatic:
+ continue
+ suite = suite.lower()
+ c.execute(query, [suite])
+
+ c.execute("UPDATE config SET value = '7' WHERE name = 'db_revision'")
+ self.db.commit()
+
+ except psycopg2.ProgrammingError, msg:
+ self.db.rollback()
+ raise DBUpdateError, "Unable to appy suite config updates, rollback issued. Error message : %s" % (str(msg))
--- /dev/null
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Debian Archive Kit Database Update Script
+Copyright © 2008 Michael Casadevall <mcasadevall@debian.org>
+Copyright © 2009 Joerg Jaspert <joerg@debian.org>
+
+Debian Archive Kit Database Update Script 8
+"""
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+################################################################################
+
+# * Ganneff ponders how to best write the text to -devel. (need to tell em in
+# case they find more bugs). "We fixed the fucking idiotic broken implementation
+# to be less so" is probably not the nicest, even if perfect valid, way to say so
+
+################################################################################
+
+import psycopg2
+import time
+from daklib.dak_exceptions import DBUpdateError
+from daklib.utils import get_conf
+
+################################################################################
+
+def do_update(self):
+ print "Moving some more of the suite config into the DB"
+ Cnf = get_conf()
+
+ try:
+ c = self.db.cursor()
+
+ c.execute("ALTER TABLE suite ADD COLUMN copychanges TEXT;")
+ query = "UPDATE suite SET copychanges = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ copychanges = Cnf.Find("Suite::%s::CopyChanges" % (suite))
+ print "[CopyChanges] Processing suite %s" % (suite)
+ if not copychanges:
+ continue
+ suite = suite.lower()
+ c.execute(query, [copychanges, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN copydotdak TEXT;")
+ query = "UPDATE suite SET copydotdak = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ copydotdak = Cnf.Find("Suite::%s::CopyDotDak" % (suite))
+ print "[CopyDotDak] Processing suite %s" % (suite)
+ if not copydotdak:
+ continue
+ suite = suite.lower()
+ c.execute(query, [copydotdak, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN commentsdir TEXT;")
+ query = "UPDATE suite SET commentsdir = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ commentsdir = Cnf.Find("Suite::%s::CommentsDir" % (suite))
+ print "[CommentsDir] Processing suite %s" % (suite)
+ if not commentsdir:
+ continue
+ suite = suite.lower()
+ c.execute(query, [commentsdir, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN overridesuite TEXT;")
+ query = "UPDATE suite SET overridesuite = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ overridesuite = Cnf.Find("Suite::%s::OverrideSuite" % (suite))
+ print "[OverrideSuite] Processing suite %s" % (suite)
+ if not overridesuite:
+ continue
+ suite = suite.lower()
+ c.execute(query, [overridesuite, suite])
+
+ c.execute("ALTER TABLE suite ADD COLUMN changelogbase TEXT;")
+ query = "UPDATE suite SET changelogbase = %s WHERE suite_name = %s" #: Update query
+ for suite in Cnf.SubTree("Suite").List():
+ changelogbase = Cnf.Find("Suite::%s::ChangeLogBase" % (suite))
+ print "[ChangeLogBase] Processing suite %s" % (suite)
+ if not changelogbase:
+ continue
+ suite = suite.lower()
+ c.execute(query, [changelogbase, suite])
+
+ c.execute("UPDATE config SET value = '8' WHERE name = 'db_revision'")
+ self.db.commit()
+
+ except psycopg2.ProgrammingError, msg:
+ self.db.rollback()
+ raise DBUpdateError, "Unable to apply suite config updates, rollback issued. Error message : %s" % (str(msg))
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:
cursor.execute( """SELECT 1 FROM source s
JOIN src_associations sa ON (s.id = sa.source)
WHERE s.source = %(source)s
- AND s.version = '%(version)s'
+ AND s.version = %(version)s
AND sa.suite = %(suite)d""",
{'source' : changes['source'],
'version' : changes['version'],
Cnf = None
projectB = None
-required_database_schema = 6
+required_database_schema = 8
################################################################################
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.lower())
+ 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):
@return: the database id for the given suite
"""
- return self.__get_id('id', 'suite', 'suite_name', suite)
+ return int(self.__get_id('id', 'suite', 'suite_name', suite))
def get_section_id(self, section):
"""
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-* Ganneff ponders how to best write the text to -devel. (need to tell em in
- case they find more bugs). "We fixed the fucking idiotic broken implementation
- to be less so" is probably not the nicest, even if perfect valid, way to say so
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[single issue]
-For the stable distribution (etch), this problem has been fixed in version XXX
+For the old stable distribution (etch), this problem has been fixed in version XXX
+__PACKAGE__
+
+For the stable distribution (lenny), this problem has been fixed in version XXX
__PACKAGE__
For the unstable distribution (sid), this problem has been fixed in
version XXX
[multiple issues]
-For the stable distribution (etch), these problems have been fixed in version
+For the old stable distribution (etch), these problems have been fixed in version
+__PACKAGE__
+
+For the stable distribution (lenny), these problems have been fixed in version
__PACKAGE__
For the unstable distribution (sid), these problems have been fixed in
Debian GNU/Linux 4.0 alias etch
-------------------------------
+Debian GNU/Linux 5.0 alias lenny
+--------------------------------
+
__ADVISORY_TEXT__