From: Ansgar Burchardt Date: Sun, 4 Nov 2012 13:58:04 +0000 (+0100) Subject: make-changelog: add archive option X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80a6a79b8b82ec9bda2fa68f69ce611048a4d110;p=dak make-changelog: add archive option We do not want to export changelogs for policy queues such as embargoed. --- diff --git a/config/debian-security/export.sh b/config/debian-security/export.sh index 81d5ee08..f3520e82 100755 --- a/config/debian-security/export.sh +++ b/config/debian-security/export.sh @@ -19,7 +19,7 @@ export LC_ALL=C # extract changelogs and stuff function changelogs() { log "Extracting changelogs" - dak make-changelog -e + dak make-changelog -e -a security mkdir -p ${exportpublic}/changelogs cd ${exportpublic}/changelogs rsync -aHW --delete --delete-after --ignore-errors ${exportdir}/changelogs/. . diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index c32733cf..064ba81b 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -575,7 +575,7 @@ EOF # extract changelogs and stuff function changelogs() { log "Extracting changelogs" - dak make-changelog -e + dak make-changelog -e -a ftp-master mkdir -p ${exportpublic}/changelogs cd ${exportpublic}/changelogs rsync -aHW --delete --delete-after --ignore-errors ${exportdir}/changelogs/. . diff --git a/dak/make_changelog.py b/dak/make_changelog.py index d2b9ba7b..dbcbf576 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -160,10 +160,11 @@ def display_changes(uploads, index): print upload[index] prev_upload = upload[0] -def export_files(session, pool, clpool): +def export_files(session, archive, clpool): """ Export interesting files from source packages. """ + pool = os.path.join(archive.path, 'pool') sources = {} unpack = {} @@ -177,9 +178,10 @@ def export_files(session, pool, clpool): JOIN files f ON f.id = s.file JOIN files_archive_map fam ON f.id = fam.file_id AND fam.archive_id = su.id JOIN component c ON fam.component_id = c.id + WHERE su.archive = :archive_id ORDER BY s.source, suite""" - for p in session.execute(query): + for p in session.execute(query, {'archive_id': archive.archive_id}): if not sources.has_key(p[0]): sources[p[0]] = {} sources[p[0]][p[1]] = (re_no_epoch.sub('', p[2]), p[3]) @@ -256,6 +258,7 @@ def main(): Cnf = utils.get_conf() cnf = Config() Arguments = [('h','help','Make-Changelog::Options::Help'), + ('a','archive','Make-Changelog::Options::Help','HasArg'), ('s','suite','Make-Changelog::Options::Suite','HasArg'), ('b','base-suite','Make-Changelog::Options::Base-Suite','HasArg'), ('n','binnmu','Make-Changelog::Options::binNMU'), @@ -283,8 +286,9 @@ def main(): 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) - export_files(session, Cnf['Dir::Pool'], exportpath) + export_files(session, archive, exportpath) else: utils.fubar('No changelog export path defined') elif binnmu: