Package: apt-listchanges Version: 2.85.7+squeeze1 Severity: wishlist
Hi, we have many hosts which send apt-listchanges reports via mail. Since all these mails are fed into our ticketsystem, it would be very nice to configure the subject that the mail gets attached to the right ticket automatically. This patch does exactly this: >From 889ac87ab7dee734cc1787c7916922f92b0d0af8 Mon Sep 17 00:00:00 2001 From: Christoph <c...@iphh.net> Date: Tue, 30 Aug 2011 12:14:28 +0200 Subject: [PATCH] make email-subject configurable --- apt-listchanges.py | 10 +++++++++- debian/config | 2 ++ debian/postinst | 3 +++ debian/templates | 7 +++++++ 4 files changed, 21 insertions(+), 1 deletions(-) diff --git a/apt-listchanges.py b/apt-listchanges.py index e8a195f..a28a02e 100755 --- a/apt-listchanges.py +++ b/apt-listchanges.py @@ -213,10 +213,18 @@ def main(): hostname = commands.getoutput('hostname') if config.email_address and changes: - subject = _("apt-listchanges: changelogs for %s") % hostname + if config.email_subject: + subject = config.email_subject + else: + subject = _("apt-listchanges: changelogs for %s") % hostname apt_listchanges.mail_changes(config.email_address, changes, subject) if config.email_address and news: + if config.email_subject: + subject = config.email_subject + else: + subject = _("apt-listchanges: changelogs for %s") % hostname + subject = _("apt-listchanges: news for %s") % hostname apt_listchanges.mail_changes(config.email_address, news, subject) diff --git a/debian/config b/debian/config index 0a53b15..11069fd 100644 --- a/debian/config +++ b/debian/config @@ -8,6 +8,8 @@ set -e db_input medium apt-listchanges/frontend || true db_input low apt-listchanges/save-seen || true db_input low apt-listchanges/email-address || true +db_input low apt-listchanges/email-subject || true + if [ "$1" = "configure" ]; then if [ -n "$2" ] && dpkg --compare-versions "$2" le 2.51; then diff --git a/debian/postinst b/debian/postinst index c974660..e09e160 100644 --- a/debian/postinst +++ b/debian/postinst @@ -16,6 +16,9 @@ then db_get apt-listchanges/email-address echo "email_address=$RET" >> $PREFERENCES.new + db_get apt-listchanges/email-subject + echo "email_subject=$RET" >> $PREFERENCES.new + db_get apt-listchanges/confirm if [ "$RET" = "true" ]; then echo "confirm=1" >> $PREFERENCES.new diff --git a/debian/templates b/debian/templates index cc4eeaa..87d6c18 100644 --- a/debian/templates +++ b/debian/templates @@ -36,6 +36,13 @@ _Description: E-mail address(es) which will receive changes: Multiple addresses may be specified, delimited by commas. Leaving this field empty disables mail notifications. +Template: apt-listchanges/email-subject +Type: string +Default: +_Description: E-mail subject : + Optionally, apt-listchanges can e-mail a copy of displayed changes + with the specified subject + Template: apt-listchanges/confirm Type: boolean Default: false -- 1.7.2.5 -- System Information: Debian Release: 6.0.1 APT prefers testing APT policy: (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: i386 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages apt-listchanges depends on: ii apt 0.8.10.3 Advanced front-end for dpkg ii debconf [debconf-2.0] 1.5.36.1 Debian configuration management sy ii debianutils 3.4 Miscellaneous utilities specific t ii python 2.6.7-3 interactive high-level object-orie ii python-apt 0.7.100.1 Python interface to libapt-pkg ii python-support 1.0.14 automated rebuilding support for P ii ucf 3.0025+nmu1 Update Configuration File: preserv Versions of packages apt-listchanges recommends: ii postfix [mail-transport-agent 2.7.1-1 High-performance mail transport ag Versions of packages apt-listchanges suggests: ii chromium-br 6.0.472.63~r59945-5+squeeze4 Chromium browser ii elinks-lite 0.12~pre5-2 advanced text-mode WWW browser - l ii epiphany-br 2.30.6-1 Intuitive GNOME web browser ii gnome-termi 2.30.2-1 The GNOME terminal emulator applic ii iceweasel [ 4.0.1-2 Web browser based on Firefox ii konsole [x- 4:4.4.5-2 X terminal emulator ii links2 [www 2.3~pre1-1 Web browser running in both graphi ii lynx-cur [w 2.8.8dev.5-1 Text-mode WWW Browser with NLS sup ii midori [www 0.2.4-3 fast, lightweight graphical web br ii python-glad 2.17.0-4 GTK+ bindings: Glade support ii python-gtk2 2.17.0-4 Python bindings for the GTK+ widge ii roxterm [x- 1.18.5-3 Multi-tabbed GTK/VTE terminal emul ii rxvt-unicod 9.11-2 multi-lingual terminal emulator wi ii uzbl [www-b 0.0.0~git.20100403-3 Lightweight Webkit browser followi ii w3m [www-br 0.5.2-9 WWW browsable pager with excellent ii xemacs21-mu 21.4.22-3.1 highly customizable text editor -- ii xterm [x-te 261-1 X terminal emulator -- debconf information: apt-listchanges/confirm: false * apt-listchanges/email-address: supp...@iphh.net * apt-listchanges/which: both * apt-listchanges/frontend: mail * apt-listchanges/save-seen: true -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org