bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run-time dynamic linking in grep


From: Jim Meyering
Subject: Re: Run-time dynamic linking in grep
Date: Fri, 28 Jan 2011 09:21:12 +0100

Reuben Thomas wrote:
> On 26 January 2011 17:53, Jim Meyering <address@hidden> wrote:
>>
>> Also, "make syntax-check" failed due to a useless <assert.h>
>
> What's a good way to build that into my workflow (preferably without
> running it explicitly), e.g. getting make distcheck to do it?

I've added a rule in Makefile.am.
Patch below.

>> Most importantly, non-seekable (pipe) input is not decompressed:
>> (that "null" looks suspicious, too)
>>
>>    $ echo foo|gzip|src/grep --decompress o
>>    src/grep: (null): Illegal seek
>>
>> It would sure be nice to fix that.
>
> This is a pain. The null is easy: I had misunderstood the format of
> the error() calls, and shouldn't've been passing file to error when
> file was null.
>
> The not seeking is harder. If transparent decompression is going to
> cope with pipes (and if not, one might as well just use a zgrep
> wrapper), then I can't seek in zio.c. But if I can't seek, then I
> can't check the magic by loading it in before calling a function like
> gzdopen. And gzdopen won't tell me whether it is actually
> uncompressing or not; and in any case, it will presumably read some
> data, so I will be left without a virgin descriptor that I can pass on
> to BZ2_bzdopen.
>
> In short, I can't think of a way to use the compression veneers to do
> what I want; it looks like I'll have to adapt them instead (so I can
> read the magic, check it, and then implement manual buffering to feed
> the relevant decompression function).

Good.  I think that's the way to do it, too.

>From 2ad572d9a7ae77b0ce95b81f360f6fb0481b4ee7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 28 Jan 2011 08:13:22 +0100
Subject: [PATCH 1/2] build: run syntax-check rules as part of "make dist"

* Makefile.am (dist-hook): Depend on syntax-check.
Suggested by Reuben Thomas.
---
 Makefile.am |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e85aea8..a702c2e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,6 +33,10 @@ EXTRA_DIST =         \
 dist-hook: gen-ChangeLog
        $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version

+# Run syntax-check rules before creating a distribution tarball.
+dist-hook:
+       $(AM_V_GEN)test -d .git && $(MAKE) syntax-check || :
+
 gen_start_date = 2009-11-27
 .PHONY: gen-ChangeLog
 gen-ChangeLog:
--
1.7.3.5.44.g960a


>From c86b697d55e2cd789d50e398c0baf755175ac4db Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 28 Jan 2011 08:29:04 +0100
Subject: [PATCH 2/2] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index a2e8447..1bf9d10 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit a2e8447d6b8abe23504f4f2d4757a60a2e8bee54
+Subproject commit 1bf9d10cc5e78c522b6e28a7dc43a10e6dcfaaed
--
1.7.3.5.44.g960a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]