From: Joerg Jaspert Date: Mon, 29 Apr 2013 12:46:40 +0000 (+0200) Subject: Merge remote-tracking branch 'drkranz/changelogs' into merge X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=84665aa9fd206376672a4c1590abb5b39e67bab4;hp=50cb037769a610fac0b51594352f33ae674d7b93;p=dak.git Merge remote-tracking branch 'drkranz/changelogs' into merge * drkranz/changelogs: Remove references to changelog exportpath, no longer used Use changelog export path derived from projectb Add changelog column to archive table xzip changelog listing file --- diff --git a/config/backports/dak.conf b/config/backports/dak.conf index c3fec8e4..890cd6b3 100644 --- a/config/backports/dak.conf +++ b/config/backports/dak.conf @@ -344,11 +344,6 @@ Import-LDAP-Fingerprints KeyServer "wwwkeys.eu.pgp.net"; }; -Changelogs -{ - Export "/srv/backports-master.debian.org/export/changelogs"; -} - Generate-Releases { MD5Sum diff --git a/config/debian-security/dak.conf b/config/debian-security/dak.conf index c1b6c94e..7a438ba1 100644 --- a/config/debian-security/dak.conf +++ b/config/debian-security/dak.conf @@ -350,11 +350,6 @@ Urgency }; }; -Changelogs -{ - Export "/srv/security-master.debian.org/export/changelogs"; -} - Generate-Releases { MD5Sum diff --git a/config/debian/dak.conf b/config/debian/dak.conf index 85ff4a39..fc0ec404 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -277,7 +277,6 @@ Dir Root "/srv/ftp-master.debian.org/ftp/"; Pool "/srv/ftp-master.debian.org/ftp/pool/"; Templates "/srv/ftp-master.debian.org/dak/templates/"; - Export "/srv/ftp-master.debian.org/export/"; Lists "/srv/ftp-master.debian.org/database/dists/"; Cache "/srv/ftp-master.debian.org/database/"; Log "/srv/ftp-master.debian.org/log/"; diff --git a/config/debian/dak.conf-backports b/config/debian/dak.conf-backports index 40582b09..8a7a9f36 100644 --- a/config/debian/dak.conf-backports +++ b/config/debian/dak.conf-backports @@ -5,7 +5,6 @@ Dinstall { Dir { Log "/srv/backports-master.debian.org/log/"; Lock "/srv/backports-master.debian.org/lock/"; - Export "/srv/backports-master.debian.org/export/"; }; Rm { diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index a2e97206..f6287a8d 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -616,12 +616,14 @@ EOF function changelogs() { log "Extracting changelogs" dak make-changelog -e -a ftp-master + [ -f ${exportdir}/changelogs/filelist.yaml ] && xz -f ${exportdir}/changelogs/filelist.yaml mkdir -p ${exportpublic}/changelogs cd ${exportpublic}/changelogs rsync -aHW --delete --delete-after --ignore-errors ${exportdir}/changelogs/. . sudo -H -u staticsync /usr/local/bin/static-update-component ftp-master.metadata.debian.org >/dev/null 2>&1 & #dak make-changelog -e -a backports + #[ -f /srv/backports-master.debian.org/export/changelogs/filelist.yaml ] && xz -f /srv/backports-master.debian.org/export/changelogs/filelist.yaml #mkdir -p /srv/backports-master.debian.org/rsync/export/changelogs #cd /srv/backports-master.debian.org/rsync/export/changelogs #rsync -aHW --delete --delete-after --ignore-errors /srv/backports-master.debian.org/export/changelogs/. . diff --git a/dak/dakdb/update97.py b/dak/dakdb/update97.py new file mode 100644 index 00000000..c6f7fd4b --- /dev/null +++ b/dak/dakdb/update97.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# coding=utf8 + +""" +Create path entries for changelog exporting + +@contact: Debian FTP Master +@copyright: 2013 Luca Falavigna +@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 + +################################################################################ +def do_update(self): + """ + Move changelogs related config values into projectb + """ + print __doc__ + try: + c = self.db.cursor() + c.execute("ALTER TABLE archive ADD COLUMN changelog text NULL") + c.execute("UPDATE archive SET changelog = '/srv/ftp-master.debian.org/export/changelogs' WHERE name = 'ftp-master'") + c.execute("UPDATE archive SET changelog = '/srv/backports-master.debian.org/export/changelogs' WHERE name = 'backports'") + c.execute("DELETE FROM config WHERE name = 'exportpath'") + c.execute("UPDATE config SET value = '97' WHERE name = 'db_revision'") + self.db.commit() + + except psycopg2.ProgrammingError as msg: + self.db.rollback() + raise DBUpdateError('Unable to apply table-column update 97, rollback issued. Error message : %s' % (str(msg))) diff --git a/dak/make_changelog.py b/dak/make_changelog.py index 2d52d069..b904deaa 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -57,7 +57,6 @@ from shutil import rmtree from yaml import safe_dump from daklib.dbconn import * from daklib import utils -from daklib.config import Config from daklib.contents import UnpackedSource from daklib.regexes import re_no_epoch @@ -293,7 +292,6 @@ def generate_export_filelist(clpool): def main(): Cnf = utils.get_conf() - cnf = Config() Arguments = [('h','help','Make-Changelog::Options::Help'), ('a','archive','Make-Changelog::Options::Archive','HasArg'), ('s','suite','Make-Changelog::Options::Suite','HasArg'), @@ -324,9 +322,9 @@ def main(): session = DBConn().session() if export: - if cnf.exportpath: - archive = session.query(Archive).filter_by(archive_name=Options['Archive']).one() - exportpath = os.path.join(Cnf['Dir::Export'], cnf.exportpath) + (archive, exportpath) = session.query(Archive.archive_name, Archive.changelog). \ + filter_by(archive_name=Options['Archive']).one() + if exportpath: export_files(session, archive, exportpath, progress) generate_export_filelist(exportpath) else: diff --git a/daklib/config.py b/daklib/config.py index 8eb45e20..a6a7951e 100755 --- a/daklib/config.py +++ b/daklib/config.py @@ -133,7 +133,6 @@ class Config(object): """ for field in [('db_revision', None, int), ('defaultsuitename', 'unstable', str), - ('exportpath', '', str), ('use_extfiles', None, int) ]: setattr(self, 'get_%s' % field[0], lambda s=None, x=field[0], y=field[1], z=field[2]: self.get_db_value(x, y, z))