unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch-mutt BSD compatibility
@ 2015-05-01  5:24 Jack Peirce
  2015-05-01  5:57 ` David Bremner
  2015-05-01  8:36 ` Stefano Zacchiroli
  0 siblings, 2 replies; 5+ messages in thread
From: Jack Peirce @ 2015-05-01  5:24 UTC (permalink / raw)
  To: notmuch@notmuchmail.org, zack@upsilon.cc

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

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

Thanks,
Jack



[-- Attachment #2: notmuch-mutt-bsd-compat.patch --]
[-- Type: text/plain, Size: 532 bytes --]

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 @@
     empty_maildir($maildir);
     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($$) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-mutt BSD compatibility
  2015-05-01  5:24 notmuch-mutt BSD compatibility Jack Peirce
@ 2015-05-01  5:57 ` David Bremner
  2015-05-01  8:36 ` Stefano Zacchiroli
  1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2015-05-01  5:57 UTC (permalink / raw)
  To: Jack Peirce, notmuch@notmuchmail.org, zack@upsilon.cc

Jack Peirce <JPeirce@sourcecode.com> writes:
0 2015
> +++ new/contrib/notmuch-mutt/notmuch-mutt	Thu Apr 30 23:10:21 2015
> @@ -50,7 +50,7 @@
>      empty_maildir($maildir);
>      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/");
>  }

Recent notmuch (since 0.15, January 2013!) has the --format=text0 option for
use with xargs -0.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-mutt BSD compatibility
  2015-05-01  5:24 notmuch-mutt BSD compatibility Jack Peirce
  2015-05-01  5:57 ` David Bremner
@ 2015-05-01  8:36 ` Stefano Zacchiroli
  2015-05-02  8:37   ` Tomi Ollila
  2015-05-04  8:48   ` David Bremner
  1 sibling, 2 replies; 5+ messages in thread
From: Stefano Zacchiroli @ 2015-05-01  8:36 UTC (permalink / raw)
  To: Jack Peirce; +Cc: notmuch@notmuchmail.org


[-- Attachment #1.1: Type: text/plain, Size: 804 bytes --]

On Fri, May 01, 2015 at 05:24:39AM +0000, Jack Peirce wrote:
> 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.

I wasn't aware of that, so thanks for spotting it and for your patch.

The patch looks good to me. I've also tested on my GNU/Linux machine and
it works fine.

David, please consider the attached (format-)patch for inclusion into
the upcoming release of Notmuch.

Cheers.
-- 
Stefano Zacchiroli  . . . . . . .  zack@upsilon.cc . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Former Debian Project Leader  . . @zack on identi.ca . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

[-- Attachment #1.2: 0001-notmuch-mutt-fix-xargs-ln-usage-for-OpenBSD-compatib.patch --]
[-- Type: text/x-diff, Size: 1045 bytes --]

From 8641b7bc815d3a50a25069018faeb773b30499f2 Mon Sep 17 00:00:00 2001
From: Jack Peirce <JPeirce@sourcecode.com>
Date: Fri, 1 May 2015 10:32:05 +0200
Subject: [PATCH] notmuch-mutt: fix xargs/ln usage for OpenBSD compatibility

- 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

Signed-off-by: Stefano Zacchiroli <zack@upsilon.cc>
---
 contrib/notmuch-mutt/notmuch-mutt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
index 126cbf4..b47b365 100755
--- a/contrib/notmuch-mutt/notmuch-mutt
+++ b/contrib/notmuch-mutt/notmuch-mutt
@@ -50,7 +50,7 @@ sub search($$$) {
     empty_maildir($maildir);
     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($$) {
-- 
2.1.4


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: notmuch-mutt BSD compatibility
  2015-05-01  8:36 ` Stefano Zacchiroli
@ 2015-05-02  8:37   ` Tomi Ollila
  2015-05-04  8:48   ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: Tomi Ollila @ 2015-05-02  8:37 UTC (permalink / raw)
  To: Stefano Zacchiroli, Jack Peirce; +Cc: notmuch@notmuchmail.org

On Fri, May 01 2015, Stefano Zacchiroli <zack@upsilon.cc> wrote:

> On Fri, May 01, 2015 at 05:24:39AM +0000, Jack Peirce wrote:
>> 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.
>
> I wasn't aware of that, so thanks for spotting it and for your patch.
>
> The patch looks good to me. I've also tested on my GNU/Linux machine and
> it works fine.
>
> David, please consider the attached (format-)patch for inclusion into
> the upcoming release of Notmuch.

This change LGTM.

Tomi

>
> Cheers.
> -- 
> Stefano Zacchiroli  . . . . . . .  zack@upsilon.cc . . . . o . . . o . o
> Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
> Former Debian Project Leader  . . @zack on identi.ca . . o o o . . . o .
> « the first rule of tautology club is the first rule of tautology club »
> From 8641b7bc815d3a50a25069018faeb773b30499f2 Mon Sep 17 00:00:00 2001
> From: Jack Peirce <JPeirce@sourcecode.com>
> Date: Fri, 1 May 2015 10:32:05 +0200
> Subject: [PATCH] notmuch-mutt: fix xargs/ln usage for OpenBSD compatibility
>
> - 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
>
> Signed-off-by: Stefano Zacchiroli <zack@upsilon.cc>
> ---
>  contrib/notmuch-mutt/notmuch-mutt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
> index 126cbf4..b47b365 100755
> --- a/contrib/notmuch-mutt/notmuch-mutt
> +++ b/contrib/notmuch-mutt/notmuch-mutt
> @@ -50,7 +50,7 @@ sub search($$$) {
>      empty_maildir($maildir);
>      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($$) {
> -- 
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: notmuch-mutt BSD compatibility
  2015-05-01  8:36 ` Stefano Zacchiroli
  2015-05-02  8:37   ` Tomi Ollila
@ 2015-05-04  8:48   ` David Bremner
  1 sibling, 0 replies; 5+ messages in thread
From: David Bremner @ 2015-05-04  8:48 UTC (permalink / raw)
  To: Stefano Zacchiroli, Jack Peirce; +Cc: notmuch@notmuchmail.org

Stefano Zacchiroli <zack@upsilon.cc> writes:

>
> David, please consider the attached (format-)patch for inclusion into
> the upcoming release of Notmuch.
>

OK, it's included in the release candidate tagged I just tagged
(and uploaded to debian experimental).

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-04  8:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01  5:24 notmuch-mutt BSD compatibility Jack Peirce
2015-05-01  5:57 ` David Bremner
2015-05-01  8:36 ` Stefano Zacchiroli
2015-05-02  8:37   ` Tomi Ollila
2015-05-04  8:48   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).