Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1421F429E25 for ; Wed, 26 Oct 2011 03:04:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y-fN-yKHUfjc for ; Wed, 26 Oct 2011 03:04:57 -0700 (PDT) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 40BB9431FB6 for ; Wed, 26 Oct 2011 03:04:57 -0700 (PDT) Received: from taco2.nixu.fi (localhost [127.0.0.1]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9QA4tb9032700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 26 Oct 2011 13:04:55 +0300 Received: (from too@localhost) by taco2.nixu.fi (8.14.3/8.14.3/Submit) id p9QA4tPj032699; Wed, 26 Oct 2011 13:04:55 +0300 X-Authentication-Warning: taco2.nixu.fi: too set sender to tomi.ollila@nixu.com using -f From: Tomi Ollila To: notmuch@notmuchmail.org Subject: remote-notmuch.sh X-Face: HhBM'cA~ User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2011 10:04:58 -0000 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.