Author: adam-guest
Date: 2008-04-04 19:49:15 +0000 (Fri, 04 Apr 2008)
New Revision: 1237
Modified:
trunk/debian/changelog
trunk/scripts/bts.pl
Log:
bts:
+ Automatically append "thanks" and the contents of ~/.signature
(if present) when --force-interactive was used (Closes: #474205)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-04-04 19:26:54 UTC (rev 1236)
+++ trunk/debian/changelog 2008-04-04 19:49:15 UTC (rev 1237)
@@ -1,6 +1,9 @@
devscripts (2.10.21) UNRELEASED; urgency=low
- * bts: Allow SMTP authentication to be used when sending e-mails
+ * bts:
+ + Allow SMTP authentication to be used when sending e-mails
+ + Automatically append "thanks" and the contents of ~/.signature
+ (if present) when --force-interactive was used (Closes: #474205)
* bug/script:
+ Don't produce an error if either of the configuration files doesn't
exist (Closes: #472748)
Modified: trunk/scripts/bts.pl
===================================================================
--- trunk/scripts/bts.pl 2008-04-04 19:26:54 UTC (rev 1236)
+++ trunk/scripts/bts.pl 2008-04-04 19:49:15 UTC (rev 1237)
@@ -1935,6 +1935,7 @@
. "# Automatically generated email from bts,"
. " devscripts version $version\n";
+ $body = addfooter($body);
$body = confirmmail($message, $body);
return if not defined $body;
@@ -2051,6 +2052,7 @@
. "# Automatically generated email from bts,"
. " devscripts version $version\n";
+ $body = addfooter($body);
$body = confirmmail($header, $body);
return if not defined $body;
@@ -2115,6 +2117,25 @@
return $body;
}
+sub addfooter() {
+ my $body = shift;
+
+ if ($forceinteractive) {
+ $body .= "thanks\n";
+ if (-r $ENV{'HOME'} . "/.signature") {
+ if (open SIG, "<", $ENV{'HOME'} . "/.signature") {
+ $body .= "-- \n";
+ while(<SIG>) {
+ $body .= $_;
+ }
+ close SIG;
+ }
+ }
+ }
+
+ return $body;
+}
+
sub getpass() {
system "stty -echo cbreak </dev/tty";
die "bts: error disabling stty echo\n" if $?;
--
To unsubscribe, send mail to [EMAIL PROTECTED]