From: Mike O'Connor Date: Sat, 14 Mar 2009 14:06:49 +0000 (-0400) Subject: Merge branch 'master' into content_generation X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=cadbdf89b46a56ad6b72c91ade7f653a8441c705;hp=3b7335ec8615387761937d34423581df226c22dc;p=dak.git Merge branch 'master' into content_generation --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 599a96d4..cc2db8ad 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -738,8 +738,6 @@ GO=( ) stage $GO -ulimit -m 90000 -d 90000 -s 10000 -v 200000 - GO=( FUNC="runparts" TIME="run-parts" 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/contents.py b/dak/contents.py old mode 100644 new mode 100755 index 36546f58..1efb361f --- a/dak/contents.py +++ b/dak/contents.py @@ -278,8 +278,9 @@ class Contents(object): 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] ) @@ -376,6 +377,14 @@ def main(): '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 @@ -388,14 +397,6 @@ def main(): 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__': 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/dakdb/update7.py b/dak/dakdb/update7.py new file mode 100755 index 00000000..c8828535 --- /dev/null +++ b/dak/dakdb/update7.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# coding=utf8 + +""" +Debian Archive Kit Database Update Script +Copyright © 2008 Michael Casadevall +Copyright © 2009 Joerg Jaspert + +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)) diff --git a/dak/dakdb/update8.py b/dak/dakdb/update8.py new file mode 100755 index 00000000..fc505f7a --- /dev/null +++ b/dak/dakdb/update8.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# coding=utf8 + +""" +Debian Archive Kit Database Update Script +Copyright © 2008 Michael Casadevall +Copyright © 2009 Joerg Jaspert + +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)) diff --git a/dak/generate_index_diffs.py b/dak/generate_index_diffs.py index 774e0467..e83dfa3d 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/dak/process_unchecked.py b/dak/process_unchecked.py index aa38a003..938f839c 100755 --- a/dak/process_unchecked.py +++ b/dak/process_unchecked.py @@ -1320,7 +1320,7 @@ def is_stableupdate (): 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'], diff --git a/dak/update_db.py b/dak/update_db.py index 378dacf0..b596f2fc 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -45,7 +45,7 @@ from daklib.dak_exceptions import DBUpdateError Cnf = None projectB = None -required_database_schema = 6 +required_database_schema = 8 ################################################################################ diff --git a/daklib/database.py b/daklib/database.py index 606e8f2d..90b8e6da 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.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): diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 89072918..24cb9044 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -168,7 +168,7 @@ class DBConn(Singleton): @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): """ diff --git a/docs/README.quotes b/docs/README.quotes index c696fbeb..a71c89db 100644 --- a/docs/README.quotes +++ b/docs/README.quotes @@ -345,8 +345,3 @@ Canadians: This is a lighthouse. Your call. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -* 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 - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/templates/security-install.advisory b/templates/security-install.advisory index eea2e937..9036bd01 100644 --- a/templates/security-install.advisory +++ b/templates/security-install.advisory @@ -28,14 +28,20 @@ Foo discovered that [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 @@ -66,6 +72,9 @@ footer to the proper configuration. Debian GNU/Linux 4.0 alias etch ------------------------------- +Debian GNU/Linux 5.0 alias lenny +-------------------------------- + __ADVISORY_TEXT__