>> >> Hi, >> >> >> >> Yesterday Stuart posted on openbsd-ports mailing list >> >> http://marc.info/?l=openbsd-ports&m=130463274817335&w=2 >> >> and I downloaded his work and tried it out on OpenBSD amd64. >> >> >> >> I built the port and exactly like him when I do the following, I get >> >> following error. >> >> >> >> # spatch -debug -sp_file demos/simple.cocci demos/simple.c >> >> init_defs_builtins: /usr/local/share/coccinelle/standard.h >> >> ----------------------------------------------------------------------- >> >> processing semantic patch file: demos/simple.cocci >> >> with isos from: /usr/local/share/coccinelle/standard.iso >> >> ----------------------------------------------------------------------- >> >> @@ expression E; @@ >> >> >> >> - f(E); >> >> + f(E,3); >> >> >> >> >> >> HANDLING: demos/simple.c >> >> No matches found for f >> >> Skipping:demos/simple.c >> >> Check duplication for 1 files >> >> grep failed: egrep -q '(\bf\b)' demos/simple.c >> >> >> >> Can anybody guess what's wrong after seeing the grep failed message? >> >> Although it might be strange to see OpenBSD specific stuff to be >> >> asked, I thought somebody might see the problem right away. >> >> >> >> I tried to run verbose subsystem options but they were not useful, >> >> only -debug was useful. >> > >> > It works for me on Linux. Try running the egrep command shown without the >> > -q option from the coccinelle directory, ie a directory that contains >> > demos. It should find two calls to f. >> > >> > You can also try the option -disable_worth_trying_opt, which will get rid >> > of this preliminary egrep test. >> > >> > julia >> >> Hi, >> >> I also posted to openbsd-ports for help and Matthias posted a good >> workaround which did the trick also. >> http://marc.info/?l=openbsd-ports&m=130485144122003&w=2 >> >> Your suggested workaround also works but the problem with that is that >> I can't see a way to pass it to configure, which is very basic (as it >> should be!). >> >> Can you please see if his workaround can be integrated into RC2 after >> proper testing on Linux, other BSD's, other supported OS? > > Thanks for the update. I'm not completely sure to understand the > solution, though. Could we just use the linux pattern as is, and then > call gegrep instead of egrep? > > julia
Hi, I checked and yes just subbing egrep with gegrep works. But can't you please remove the dependency on gnu grep? It makes the jobs of porters very hard to track down and hunt such GNU specific problems every release. Matthias gave a better substitution, which can work on Linux too and probably other systems. Can't you please try it out to see if it works on Linux and gnu grep? It does, it is equivalent according to this page, from which I got the clue http://linux.about.com/library/cmd/blcmdl1_egrep.htm inlining diff so you can try it out, if you wish. Peace, amit --- cocci.ml.orig Sun May 8 14:24:33 2011 +++ cocci.ml Sun May 8 14:26:39 2011 @@ -485,13 +485,13 @@ let worth_trying cfiles tokens = let tokens = tokens +> List.map (fun s -> match () with | _ when s =~ "^[A-Za-z_][A-Za-z_0-9]*$" -> - "\\b" ^ s ^ "\\b" + "[[:<:]]" ^ s ^ "[[:>:]]" | _ when s =~ "^[A-Za-z_]" -> - "\\b" ^ s + "[[:<:]]" ^ s | _ when s =~ ".*[A-Za-z_]$" -> - s ^ "\\b" + s ^ "[[:>:]]" | _ -> s ) in _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
