ARCHLIST=$(tempfile)
- log "Querying $PGDATABASE..."
+ log "Querying postgres..."
echo 'SELECT l.path, f.filename, a.arch_string FROM location l JOIN files f ON (f.location = l.id) LEFT OUTER JOIN (binaries b JOIN architecture a ON (b.architecture = a.id)) ON (f.id = b.file)' | psql -At | sed 's/|//;s,^/srv/ftp-master.debian.org/ftp,.,' | sort >$ARCHLIST
includedirs () {
DB
{
- Name "obscurity";
- Host "";
- Port -1;
-
+ Service "obscurity";
+ // PoolSize should be at least ThreadCount + 1
+ PoolSize 5;
+ // MaxOverflow shouldn't exceed postgresql.conf's max_connections - PoolSize
+ MaxOverflow 13;
+ // should be false for encoding == SQL_ASCII
+ Unicode "false"
};
Architectures
ARCHLIST=$(tempfile)
- log "Querying $PGDATABASE..."
+ log "Querying postgres"
echo 'SELECT l.path, f.filename, a.arch_string FROM location l JOIN files f ON (f.location = l.id) LEFT OUTER JOIN (binaries b JOIN architecture a ON (b.architecture = a.id)) ON (f.id = b.file)' | psql -At | sed 's/|//;s,^/srv/ftp-master.debian.org/ftp,.,' | sort >$ARCHLIST
includedirs () {
--- /dev/null
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Suite.version can be null
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2011 Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+"""
+
+# 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
+
+################################################################################
+
+import psycopg2
+from daklib.dak_exceptions import DBUpdateError
+from socket import gethostname;
+
+################################################################################
+def do_update(self):
+ """
+ Add table for source contents.
+ """
+ print __doc__
+ try:
+ c = self.db.cursor()
+
+ c.execute("ALTER TABLE suite ALTER COLUMN version DROP NOT NULL")
+ c.execute("UPDATE suite SET version=NULL WHERE version='-'")
+
+ c.execute("UPDATE config SET value = '48' WHERE name = 'db_revision'")
+ self.db.commit()
+
+ except psycopg2.ProgrammingError, msg:
+ self.db.rollback()
+ raise DBUpdateError, 'Unable to apply sick update 48, rollback issued. Error message : %s' % (str(msg))
################################################################################
Cnf = None
-required_database_schema = 47
+required_database_schema = 48
################################################################################
backref=backref('binaries', lazy='dynamic')),
extra_sources = relation(DBSource, secondary=self.tbl_extra_src_references,
backref=backref('extra_binary_references', lazy='dynamic')),
- key = relation(BinaryMetadata,
+ key = relation(BinaryMetadata, cascade='all',
collection_class=attribute_mapped_collection('key'))),
extension = validator)
suites = relation(Suite, secondary=self.tbl_src_associations,
backref=backref('sources', lazy='dynamic')),
srcuploaders = relation(SrcUploader),
- key = relation(SourceMetadata,
+ key = relation(SourceMetadata, cascade='all',
collection_class=attribute_mapped_collection('key'))),
extension = validator)
self.assertEqual('http://debian.org', self.src_hello.metadata[self.homepage])
self.assertTrue(self.depends not in self.src_hello.metadata)
+ def test_delete(self):
+ '''
+ Tests the delete / cascading behaviour.
+ '''
+ self.setup_metadata()
+ self.session.delete(self.bin_hello)
+ # Remove associated binaries because we have no cascading rule for
+ # them.
+ for binary in self.src_hello.binaries:
+ self.session.delete(binary)
+ self.session.delete(self.src_hello)
+ self.session.flush()
+
if __name__ == '__main__':
unittest.main()