diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-03-06 11:10:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-03-06 11:14:23 -0700 |
commit | b0ecd18115bb4fa1887da6c590353f9f5a76434f (patch) | |
tree | cb7d1e13b4911d5d24a1571e767f088bb748d1ba /notmuch-slurp-debbug | |
parent | a8e20002c52a70176fba2741b6fbf58ac7ede767 (diff) | |
download | mailscripts-b0ecd18115bb4fa1887da6c590353f9f5a76434f.tar.gz |
notmuch-slurp-debbug: use IPC::System::Simple
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'notmuch-slurp-debbug')
-rwxr-xr-x | notmuch-slurp-debbug | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/notmuch-slurp-debbug b/notmuch-slurp-debbug index f555329..09d05c1 100755 --- a/notmuch-slurp-debbug +++ b/notmuch-slurp-debbug @@ -25,6 +25,7 @@ use File::Spec::Functions 'catfile'; use File::Which; use File::Temp; use Getopt::Long; +use IPC::System::Simple qw(systemx capturex); use MIME::Head; my $Config = Config::Tiny->new; @@ -67,7 +68,7 @@ my $bts_server_arg = defined $bts_server : undef; # see #904182 (try using this script ;)) -system(grep defined, "bts", $bts_server_arg, +systemx(grep defined, "bts", $bts_server_arg, qw(--mbox --mailreader), "true %s", "show", $bug) == 0 or die "notmuch-slurp-debbug: bts failed"; @@ -85,7 +86,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 +systemx("mbox2maildir", $mbox, $dir) == 0 or die "notmuch-slurp-debbug: mbox2maildir failed"; foreach my $message (glob "$dir/*/*") { @@ -95,9 +96,9 @@ foreach my $message (glob "$dir/*/*") { # that is asking for trouble next unless defined $mid; $mid =~ s/(<|>)//g; - my $match = `notmuch search id:$mid`; + my $match = capturex(qw(notmuch search), "id:$mid"); my $match_lines = $match =~ tr/\n//; - system("mdmv", $message, $maildir) if ($match_lines == 0); + systemx("mdmv", $message, $maildir) if ($match_lines == 0); } -system(qw(notmuch new)); +systemx(qw(notmuch new)); |