diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-03-04 19:42:04 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-03-04 19:45:52 -0700 |
commit | 0fe76a1980dfcbfe176573ec5ab1d6b360f75b17 (patch) | |
tree | db67984553e37b809e6ca042ca72891ef83c9b4b | |
parent | cff0e39b9dbf35970ce154efb0621f5abbfd2387 (diff) | |
download | mailscripts-0fe76a1980dfcbfe176573ec5ab1d6b360f75b17.tar.gz |
notmuch-slurp-debbug: avoid invoking superfluous shells
Reported-by: Paul Wise <pabs@debian.org>
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | mailscripts.el | 2 | ||||
-rwxr-xr-x | notmuch-slurp-debbug | 12 |
3 files changed, 16 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 4d66144..f6df532 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mailscripts (0.5-1) UNRELEASED; urgency=medium + + * notmuch-slurp-debbug: Avoid invoking entirely superfluous shells when + calling other tools. + Thanks to Paul Wise for reporting that the code was doing that. + + -- Sean Whitton <spwhitton@spwhitton.name> Mon, 04 Mar 2019 19:40:38 -0700 + mailscripts (0.4-1) unstable; urgency=medium * Do not import messages without a Message-Id header (Closes: #909835). diff --git a/mailscripts.el b/mailscripts.el index 249cb42..2d88500 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -1,7 +1,7 @@ ;;; mailscripts.el --- functions to access tools in the mailscripts package ;; Author: Sean Whitton <spwhitton@spwhitton.name> -;; Version: 0.4 +;; Version: 0.5 ;; Package-Requires: (notmuch) ;; Copyright (C) 2018 Sean Whitton diff --git a/notmuch-slurp-debbug b/notmuch-slurp-debbug index d289e31..e855853 100755 --- a/notmuch-slurp-debbug +++ b/notmuch-slurp-debbug @@ -64,10 +64,12 @@ die "notmuch-slurp-debbug: $maildir does not look to be a maildir" my $bts_server_arg = defined $bts_server ? "--bts-server $bts_server" - : ""; + : undef; # see #904182 (try using this script ;)) -system("bts $bts_server_arg --mbox --mailreader 'true %s' show $bug") == 0 +system(grep defined, "bts", $bts_server_arg, + qw(--mbox --mailreader), "true %s", + "show", $bug) == 0 or die "notmuch-slurp-debbug: bts failed"; my $dir = File::Temp->newdir(); @@ -83,7 +85,7 @@ my $mbox = catfile $devscripts_cache, "$bug.mbox"; # note that mb2md won't work; it thinks Debian BTS mboxes contain just # a single message -system("mbox2maildir $mbox $dir") == 0 +system("mbox2maildir", $mbox, $dir) == 0 or die "notmuch-slurp-debbug: mbox2maildir failed"; foreach my $message (glob "$dir/*/*") { @@ -95,7 +97,7 @@ foreach my $message (glob "$dir/*/*") { $mid =~ s/(<|>)//g; my $match = `notmuch search id:$mid`; my $match_lines = $match =~ tr/\n//; - system "mdmv $message $maildir" if ($match_lines == 0); + system("mdmv", $message, $maildir) if ($match_lines == 0); } -system "notmuch new"; +system(qw(notmuch new)); |