aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Anders <greg@gpanders.com>2020-03-16 12:27:42 -0600
committerDavid Bremner <david@tethera.net>2020-03-22 22:57:25 -0300
commit1fcf068e331b9b79e14f79c8b126711fc3d72cbb (patch)
treebefcc43365d669528bda9e15aa8527ff9b597580
parentea16b5ba850ae0cfad619ef2b0995a5b30ae3ebc (diff)
Make notmuch-mutt script more portable
The -D flag to install (used in the Makefile) is GNU-specific and does not work on BSD distributions (i.e. macOS). Likewise with the xargs -r flag. These changes use portable alternatives to these flags while preserving the exact behavior.
-rw-r--r--contrib/notmuch-mutt/Makefile6
-rwxr-xr-xcontrib/notmuch-mutt/notmuch-mutt2
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/notmuch-mutt/Makefile b/contrib/notmuch-mutt/Makefile
index 855438be..de933eaa 100644
--- a/contrib/notmuch-mutt/Makefile
+++ b/contrib/notmuch-mutt/Makefile
@@ -15,11 +15,11 @@ README.html: README
markdown $< > $@
install: all
- mkdir -p $(DESTDIR)$(prefix)/bin
+ mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(sysconfdir)/Muttrc.d
sed "1s|^#!.*|#! $(PERL_ABSOLUTE)|" < $(NAME) > $(DESTDIR)$(prefix)/bin/$(NAME)
chmod 755 $(DESTDIR)$(prefix)/bin/$(NAME)
- install -D -m 644 $(NAME).1 $(DESTDIR)$(mandir)/man1/$(NAME).1
- install -D -m 644 $(NAME).rc $(DESTDIR)$(sysconfdir)/Muttrc.d/$(NAME).rc
+ install -m 644 $(NAME).1 $(DESTDIR)$(mandir)/man1/
+ install -m 644 $(NAME).rc $(DESTDIR)$(sysconfdir)/Muttrc.d/
clean:
rm -f notmuch-mutt.1 README.html
diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
index 0e46a8c1..d33223bd 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 -r -I searchoutput ln -s searchoutput $maildir/cur/");
+ . " | while IFS= read -r searchoutput; do ln -s \$searchoutput $maildir/cur/; done");
}
sub prompt($$) {