]> git.decadent.org.uk Git - dak.git/commitdiff
Merge branch 'master' into content_generation
authorMike O'Connor <stew@vireo.org>
Sat, 14 Mar 2009 14:06:49 +0000 (10:06 -0400)
committerMike O'Connor <stew@vireo.org>
Sat, 14 Mar 2009 14:06:49 +0000 (10:06 -0400)
16 files changed:
config/debian/cron.dinstall
config/debian/dak.conf
dak/contents.py [changed mode: 0644->0755]
dak/control_overrides.py
dak/dakdb/update7.py [new file with mode: 0755]
dak/dakdb/update8.py [new file with mode: 0755]
dak/generate_index_diffs.py
dak/generate_releases.py
dak/make_overrides.py
dak/make_suite_file_list.py
dak/process_unchecked.py
dak/update_db.py
daklib/database.py
daklib/dbconn.py
docs/README.quotes
templates/security-install.advisory

index 599a96d4fd2f464df4bd36ecb583dc6d74caa825..cc2db8adcc0f7985dc6d3d22980b6a48404059a2 100755 (executable)
@@ -738,8 +738,6 @@ GO=(
 )
 stage $GO
 
-ulimit -m 90000 -d 90000 -s 10000 -v 200000
-
 GO=(
     FUNC="runparts"
     TIME="run-parts"
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
        {
old mode 100644 (file)
new mode 100755 (executable)
index 36546f5..1efb361
@@ -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__':
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
diff --git a/dak/dakdb/update7.py b/dak/dakdb/update7.py
new file mode 100755 (executable)
index 0000000..c882853
--- /dev/null
@@ -0,0 +1,119 @@
+#!/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))
diff --git a/dak/dakdb/update8.py b/dak/dakdb/update8.py
new file mode 100755 (executable)
index 0000000..fc505f7
--- /dev/null
@@ -0,0 +1,103 @@
+#!/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))
index 774e0467d99efd0673159f65378164d9d0b97048..e83dfa3d6f6ff5f1699c8062c3ed6b304766bb67 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 aa38a0032c5de584e63ff9a56b22236ca295b35e..938f839cca77faf441033b56d4ebeedf10c6add9 100755 (executable)
@@ -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'],
index 378dacf0e6fb585fe227819daf0c2c79420e6322..b596f2fc9f92797b2443782abdeeaf10f21abd1d 100755 (executable)
@@ -45,7 +45,7 @@ from daklib.dak_exceptions import DBUpdateError
 
 Cnf = None
 projectB = None
-required_database_schema = 6
+required_database_schema = 8
 
 ################################################################################
 
index 606e8f2de8ba76afbe38528ac77610684252dfe6..90b8e6dac1a964cf30b7c3db79d87ddd3e91e2b0 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.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):
index 89072918a2f2c25f4a7a5c81bf39fa7c26ca36ad..24cb9044aa0579892df0936e857455d507413b49 100755 (executable)
@@ -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):
         """
index c696fbebe906b2ff1590f6a9b60464b128158184..a71c89dbaa5d69b40de723388b4e855b62abb715 100644 (file)
@@ -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
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index eea2e937daa2c0859916e906896af2aa4b015c8f..9036bd01b044c4f85cbc70bd579edb9c8a7bedea 100644 (file)
@@ -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__