notmuch-mutt BSD compatibility

Subject: notmuch-mutt BSD compatibility

Date: Fri, 1 May 2015 05:24:39 +0000



From: Jack Peirce

Some of the flags used in the notmuch-mutt script included in the 
contrib directory are not supported by the OpenBSD implementation of 
ln and xargs. 

Please consider this patch which rearranges the arguments to use flags 
compatible with both Linux and BSD implementations of ln/xargs.

Do note that I do not have the ability to test this under Linux right 
now, but I am relatively confident everything should still work fine 
as long as the man pages are correct.

xargs: use -r flag instead of --no-run-if-empty
ln: use -I flag/3rd form of ln command instead of -t flag/4th form


diff -uNr old/contrib/notmuch-mutt/notmuch-mutt new/contrib/notmuch-mutt/notmuch-mutt
--- old/contrib/notmuch-mutt/notmuch-mutt	Thu Apr 30 23:08:50 2015
+++ new/contrib/notmuch-mutt/notmuch-mutt	Thu Apr 30 23:10:21 2015
@@ -50,7 +50,7 @@
     system("notmuch search --output=files $dup_option $query"
 	   . " | sed -e 's: :\\\\ :g'"
-	   . " | xargs --no-run-if-empty ln -s -t $maildir/cur/");
+	   . " | xargs -r -I searchoutput ln -s searchoutput $maildir/cur/");
 sub prompt($$) {