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 001F340BC76 for ; Mon, 9 Apr 2012 14:11:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 pbu-clYImB-y for ; Mon, 9 Apr 2012 14:11:57 -0700 (PDT) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 85B9E4040EA for ; Mon, 9 Apr 2012 14:11:57 -0700 (PDT) Received: by obqv19 with SMTP id v19so7269155obq.26 for ; Mon, 09 Apr 2012 14:11:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent:x-gm-message-state; bh=bC42mCOz39CXJKOpMa7Eg9/01psPtpVHwjd+GDG1OTw=; b=c7r00iWr/9UGlUq+4kTZh2149sui91Og0XBq9m81SbjeP4Af7BQ9h4vSpUU1PhBIe9 ouRL7GJLf45euA24MjLd6PfZITFekHm+tEDq3x7WBRPVoLxtFM0WaQbSA6OZoeaq8Skc wK9g1anCjM1Uyly7AKkphxKXV+Q1bz3zpZVgZ7c3Qb+khSv6H7SMwsg9gpyWDt/MH1FD vtWEa00vHif8IjZDwhubRD0Bj6r06PMxHjS2Xz2q68mccQNO2OCdPP7JA7JFUecvBF17 YgZ1Vp5hvBR2LOgfSKbEoBfbsaueWzOidhCIUVBuFeVNkEfGoY3oGF0etSbj1sq99Os0 BnEw== Received: by 10.60.3.34 with SMTP id 2mr12436682oez.27.1334005916929; Mon, 09 Apr 2012 14:11:56 -0700 (PDT) Received: from localhost (cpe-173-174-57-204.austin.res.rr.com. [173.174.57.204]) by mx.google.com with ESMTPS id h2sm4913995obn.20.2012.04.09.14.11.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Apr 2012 14:11:56 -0700 (PDT) Date: Mon, 9 Apr 2012 16:11:53 -0500 From: Taylor Carpenter To: notmuch@notmuchmail.org Subject: [PATCH] replace gnu xargs usage in notmuch-mutt with perl Message-ID: <20120409211153.GA6497@codecafe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkK+b7H414PboOiSbblJPc9UCW6Yit6RvJ/XAWIIV2cEiQs14fJiYsVOAw3PkUihyikFTHB 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: Mon, 09 Apr 2012 21:11:58 -0000 --- contrib/notmuch-mutt/notmuch-mutt | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt index 71206c3..dbe7f2d 100755 --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # # notmuch-mutt - notmuch (of a) helper for Mutt # @@ -12,6 +12,7 @@ use strict; use warnings; use File::Path; +use File::Basename; use Getopt::Long qw(:config no_getopt_compat); use Mail::Internet; use Mail::Box::Maildir; @@ -41,9 +42,12 @@ sub search($$) { $query = shell_quote($query); empty_maildir($maildir); - system("notmuch search --output=files $query" - . " | sed -e 's: :\\\\ :g'" - . " | xargs --no-run-if-empty ln -s -t $maildir/cur/"); + my @filelist = `notmuch search --output=files $query`; + foreach(@filelist) { + chomp; + my $target = sprintf("$maildir/cur/%s", basename($_)); + symlink($_, $target); + } } sub prompt($$) { -- 1.7.7.4