patchGNU Libtool - Patches: patch #10282, port libtool to grep 3.8 and to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10282: port libtool to grep 3.8 and to POSIX

Submitter:  Paul Eggert <eggert>
Submitted:  Mon 19 Sep 2022 08:27:13 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Tue 20 Sep 2022 06:44:00 AM UTC, comment #3: 

comment #2:

> Did you test to see if the new pattern still works with `grep` < 3.8 by any chance?

Yes, it works.

> Just to check my understanding here: the intention of `[[-]]L` is to escape `"[-]L"` in M4, taking advantage of the old `grep "[-]-not-an-option";` trick to force grep to recognize argument 1 as a pattern rather than a flag?

Yes, that's right.

> The one I didn't totally understand was removing the `@<:@` handler; mostly because I don't remember the context off hand.

Without the patch, a test is generated that runs a shell command like this:


grep '\]'


This usage of grep is not portable, since POSIX says that the regular expression \] has undefined effect (unlike \[ which is well defined to match an opening square bracket). A failure of the test does not mean that grep is broken; it means libtool is broken. To fix libtool, we should remove the incorrect test.

Paul Eggert <eggert>
Tue 20 Sep 2022 03:39:44 AM UTC, comment #2: 

Thanks for the report and patch.

Did you test to see if the new pattern still works with `grep` < 3.8 by any chance?

Just to check my understanding here: the intention of `[[-]]L` is to escape `"[-]L"` in M4, taking advantage of the old `grep "[-]-not-an-option";` trick to force grep to recognize argument 1 as a pattern rather than a flag? This one makes sense to me.

The one I didn't totally understand was removing the `@<:@` handler; mostly because I don't remember the context off hand.


Alex Ameen <growpotkin>
Group administrator
Mon 19 Sep 2022 08:32:27 PM UTC, comment #1: 

This patch partly duplicates patch #10275, but it is more complete as it fixes more instances of the problem. Sorry I did not notice this earlier. I do not know how to merge the patch requests.

Paul Eggert <eggert>
Mon 19 Sep 2022 08:27:13 PM UTC, original submission:  

GNU grep 3.8 warns about some regular expressions that POSIX says have undefined effect, e.g., '\-'. Unfortunately Libtool uses regular expressions of this form.

I'm attaching two proposed patches against libtool's current HEAD (commit 6132006b5fb6b95f31c30a972fbb829f93e1878b dated 2022-05-16). The first patch should suffice to pacify GNU grep 3.8. The second patch fixes some other regular expressions that GNU grep 3.8 does not warn about (I found them with an even-pickier 'grep').

I did not look systematically for all portability bugs of this form.

Paul Eggert <eggert>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #53720:  0001-libtool-port-to-GNU-grep-3.8.patch added by eggert (5KiB - text/x-patch - Patches to port libtool to GNU and POSIX grep)
file #53721:  0002-libtool-port-better-to-POSIX-grep.patch added by eggert (2KiB - text/x-patch - Patches to port libtool to GNU and POSIX grep)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by growpotkin (Posted a comment)
  • -email is unavailable- added by eggert (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-19 eggert Attached File- Added 0001-libtool-port-to-GNU-grep-3.8.patch, #53720
        Attached File- Added 0002-libtool-port-better-to-POSIX-grep.patch, #53721

    Back to the top

    Powered by Savane 3.12