[devscripts] 01/01: bts: Fail if sendmail is broken

Osamu Aoki osamu at moszumanska.debian.org
Fri Mar 11 11:15:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

osamu pushed a commit to branch master
in repository devscripts.

commit 4b838605d95085fdca78a4d33d249f75117a3c0c
Author: Osamu Aoki <osamu at debian.org>
Date:   Thu Mar 10 20:25:49 2016 +0000

    bts: Fail if sendmail is broken
---
 debian/changelog |  2 ++
 scripts/bts.pl   | 12 ++++--------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2659cea..c4cb0ca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ devscripts (2.16.2) UNRELEASED; urgency=medium
     + Add --list option.  Closes: #610048, #679763, #816910
   * manpage-alert:
     + Show package name etc.  Closes: #497320
+  * bts:
+    + Fail if --sendmail is broken.  Closes: #809318
 
   [ Dominique Dumont ]
   * licensecheck:
diff --git a/scripts/bts.pl b/scripts/bts.pl
index e431c6f..eb41812 100755
--- a/scripts/bts.pl
+++ b/scripts/bts.pl
@@ -542,11 +542,9 @@ if (@ARGV and $ARGV[0] =~ /^--no-?conf$/) {
         and $config_vars{'BTS_SENDMAIL_COMMAND'} ne '/usr/sbin/sendmail') {
 	my $cmd = (split ' ', $config_vars{'BTS_SENDMAIL_COMMAND'})[0];
 	unless ($cmd =~ /^~?[A-Za-z0-9_\-\+\.\/]*$/) {
-	    warn "BTS_SENDMAIL_COMMAND contained funny characters: $cmd\nReverting to default value /usr/sbin/sendmail\n";
-	    $config_vars{'BTS_SENDMAIL_COMMAND'}='/usr/sbin/sendmail';
+	    die "BTS_SENDMAIL_COMMAND contained funny characters: $cmd\nPlease fix the configuration file.\n";
 	} elsif (system("command -v $cmd >/dev/null 2>&1") != 0) {
-	    warn "BTS_SENDMAIL_COMMAND $cmd could not be executed.\nReverting to default value /usr/sbin/sendmail\n";
-	    $config_vars{'BTS_SENDMAIL_COMMAND'}='/usr/sbin/sendmail';
+	    die "BTS_SENDMAIL_COMMAND $cmd could not be executed.\nPlease fix the configuration file.\n";
 	}
     }
 
@@ -678,11 +676,9 @@ if ($opt_sendmail) {
 	and $opt_sendmail ne $sendmailcmd) {
 	my $cmd = (split ' ', $opt_sendmail)[0];
 	unless ($cmd =~ /^~?[A-Za-z0-9_\-\+\.\/]*$/) {
-	    warn "--sendmail command contained funny characters: $cmd\nReverting to default value $sendmailcmd\n";
-	    undef $opt_sendmail;
+	    die "--sendmail command contained funny characters: $cmd\n";
 	} elsif (system("command -v $cmd >/dev/null 2>&1") != 0) {
-	    warn "--sendmail command $cmd could not be executed.\nReverting to default value $sendmailcmd\n";
-	    undef $opt_sendmail;
+	    die "--sendmail command $cmd could not be executed.\n";
 	}
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list