[illumos-Developer] grep -Z etc? (decompress! was: webrev: 650 grep support for -q ...)

Albert Lee trisk at opensolaris.org
Thu May 5 20:53:11 PDT 2011


On Thu, May 5, 2011 at 10:52 PM, Yuri Pankov <yuri.pankov at gmail.com> wrote:
> On Thu, May 05, 2011 at 10:21:09PM -0400, Gordon Ross wrote:
>> I have mixed feelings about seeing uncompress support in grep.
>> Perhaps that's useful, but it violates the Unix design principle of
>> making tools that each do one thing well (or set of related things)
>> and that can be easily combined to more complex thing.
>>
>> Am I just being old fashioned?
>
> Think of archives as just another type of file. grep's purpose is to
> match lines in files (of different kind) and it does just that - using
> those libraries to look inside compressed files. It is especially useful
> when doing recursive grep. Just how I see it, anyway.
>

The motivation here is that grep's design, and the design of Unix
tools that traverse directory trees in general, is not sufficiently
flexible to implement this with a filter.

>> Note that these options cause grep to drag in
>> libzlib and libbz2 for the decompress support.
>> One of which is not in core illumos...
>
> Both of them aren't...
>
> $ grep -rE 'lib(z|bz2)\.so' usr/src/pkg/manifests/; echo $?
> 1
>

Right, common/bzip2 exists for static linking but wouldn't be the
preferred form for most of userland. Actually zlib is really
unfortunate, as there seem to be three private copies of it in the
tree.

I've also mixed feelings about ON builds gain more external
dependencies, even if they can be "easily" satisfied in this case.

> Anyway, disabling decompression will just need several #ifdef's..
>

We should probably either take it or not, rather than leaving it to bitrot.

-Albert



More information about the Developer mailing list