unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Subject: remote-notmuch.sh
Date: Wed, 26 Oct 2011 13:04:55 +0300	[thread overview]
Message-ID: <yf6ipncm5ko.fsf@taco2.nixu.fi> (raw)

Hi

The remote-notmuch.sh script on page http://notmuchmail.org/remoteusage/
starts to show it's age. As the notmuch command line interface has evolved
(and emacs ui followed) it is not working in many cases anymore.

I took the script and modified it to work in my cases so far.

If you have problems with remote-notmuch.sh take a look this modified
version. For the time being it is located at 
http://www.iki.fi/too/nottoomuch/remote-notmuch.sh

If this proves to be working better in other users use then I can
update the script on the remoteusage page also.

Changes:

Changed shebang to '#!/bin/sh' -- tested the script works with /bin/bash &
/bin/dash -- It should also work with http://heirloom.sourceforge.net/sh.html
but I did not test.

Changed sha1sum to 'openssl sha1' -- should work identically everywhere
where openssl is installed (Linux, *BSD, Mac OS X, ...).

Changed arg quote mangling for ssh command line: Every arg is encapsulated
between ':s and ':s in args replaced with '\'' construct. Note that shell
builtin echo expansions cannot be handled here but in this case this
doesn't cause problems; example: foo=-n bar='\n'; echo "$foo" x "$bar" y 
(but see at the end of this email..)

'notmuch show' checks that first arg is --format=raw and last begins with id:
-- and in this case uses the whole command line as hash key.

'case' used to choose internal command and shifts there removed.


Tomi

PS: I tested replacement for "'`echo "$arg" | sed "s/'/'\\\\\\''/"`'":

for a
do	x=`awk -v arg="$a" "BEGIN { while (index(\"'\", arg)) 
		sub(\"'\", \"'\\\\\\''\", arg); printf \"'%s'\", arg }"`
	echo "$x"
done

on command line. I include this into my script and test first before putting
to the 'released' version.

             reply	other threads:[~2011-10-26 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 10:04 Tomi Ollila [this message]
2011-10-26 15:58 ` remote-notmuch.sh Jesse Rosenthal
2011-10-26 17:48 ` remote-notmuch.sh Jani Nikula
2011-10-27  9:20   ` remote-notmuch.sh Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yf6ipncm5ko.fsf@taco2.nixu.fi \
    --to=tomi.ollila@iki.fi \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).