From 23cbaac193afe222962fe12b8a5710973678b363 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 22 Nov 2023 14:07:40 +0000 Subject: Store first msgid for announce of a srcpackage Store the first msgid allocated for a srcpackage announce, so we can set in-reply-to and thus allow threading of subsequent announces for that package. --- calm/calm.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'calm/calm.py') diff --git a/calm/calm.py b/calm/calm.py index 66337ab..e092468 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -284,9 +284,6 @@ def _announce_upload(args, scan_result, maintainer, r): # TODO: maybe other mechanisms for getting package ChangeLog? # NEWS inside upstream source tarball? - # TODO: store initial msgid for a package, so we can do in-reply-to and thus - # allow threading of announces for that package - # build the email hdr = {} hdr['From'] = maintainer.name + ' ' @@ -299,6 +296,10 @@ def _announce_upload(args, scan_result, maintainer, r): hdr['Subject'] = srcpkg.orig_name + ' ' + version + (' (TEST)' if test else '') hdr['X-Calm-Announce'] = '1' + irtid = db.announce_msgid_get(args, srcpkg.orig_name) + if irtid: + hdr['In-Reply-To'] = irtid + msg = ''' The following packages have been uploaded to the Cygwin distribution: @@ -311,7 +312,10 @@ The following packages have been uploaded to the Cygwin distribution: # TODO: add an attachment: sha512 hashes of packages, gpg signed? - utils.sendmail(hdr, msg) + msgid = utils.sendmail(hdr, msg) + + if not irtid: + db.announce_msgid_set(args, srcpkg.orig_name, msgid) def _process_maintainer_uploads(scan_result, args, state, all_packages, m, basedir, desc): -- cgit v1.2.3