[PATCH] notmuch-mutt: replace gnu sed and xargs with perl
Taylor Carpenter
taylor at codecafe.com
Thu Apr 12 11:29:59 PDT 2012
On Thu, Apr 12, 2012 at 02:07, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> On Thu, Apr 12 2012, Taylor Carpenter wrote:
>
>> External software dependencies removed: sed and xargs.
>>
>> Sed shell escaping is handled automatically with perl symlink function.
>>
>> The xargs usage is specific to gnu xargs (fails on bsd xargs, etc).
>>
>> NOTE: The current query pulls the list of files into an array all at
>> once. The larger the list the more memory used.
>> ---
> It is not too hard to read the filelist from pipe; Check the example
> I sent in id:"m2hawr4klm.fsf at guru.guru-group.fi"
Understood.
> Btw: what if there are same filenames in different directories that
> match. With basename there will be collision.
FYI, the current xargs version does not handle collisions either.
> Alternatives:
>
> * instead of basename convert '/':s to '_':s
> * take md5 or sha1 sum of the filename
> * take md5 or sha1 sum of dirname of the filename and concatenate...
How about pre-pending some unique text to the colliding file?
Regards,
Taylor
More information about the notmuch
mailing list