* [Cocci] [bug] file not found with id-utils and include-headers
@ 2013-10-13 13:30 Wolfram Sang
2013-10-13 15:47 ` Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2013-10-13 13:30 UTC (permalink / raw)
To: cocci
Hi,
using the latest Debian package from testing (rc18) and the following
spatch on the Linux Kernel:
@@
expression e;
@@
- INIT_COMPLETION(e);
+ reinit_completion(&e);
Running with:
spatch --sp-file /tmp/reinit_completion.cocci --use-idutils --include-headers ./
I get:
init_defs_builtins: /usr/share/coccinelle/standard.h
got files
HANDLING: INIT_COMPLETION drivers/hid/hid-wiimote.h
egrep: INIT_COMPLETION: No such file or directory
EXN:Sys_error("INIT_COMPLETION drivers/hid/hid-wiimote.h: No such file or directory")
...
The following files are processeed correctly. This call works on the
file which fails above:
spatch --sp-file /tmp/reinit_completion.cocci --include-headers ./drivers/hid/
I hope you can reproduce.
Regards,
Wolfram
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20131013/e3f85649/attachment.asc>
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cocci] [bug] file not found with id-utils and include-headers
2013-10-13 13:30 [Cocci] [bug] file not found with id-utils and include-headers Wolfram Sang
@ 2013-10-13 15:47 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2013-10-13 15:47 UTC (permalink / raw)
To: cocci
On Sun, 13 Oct 2013, Wolfram Sang wrote:
> Hi,
>
> using the latest Debian package from testing (rc18) and the following
> spatch on the Linux Kernel:
>
> @@
> expression e;
> @@
> - INIT_COMPLETION(e);
> + reinit_completion(&e);
>
>
> Running with:
>
> spatch --sp-file /tmp/reinit_completion.cocci --use-idutils --include-headers ./
>
> I get:
>
> init_defs_builtins: /usr/share/coccinelle/standard.h
> got files
> HANDLING: INIT_COMPLETION drivers/hid/hid-wiimote.h
> egrep: INIT_COMPLETION: No such file or directory
Idutils seems to put the matched pattern at the beginning of the first
line of output, if there is any. This is fixed by the patch below.
julia
diff --git a/parsing_cocci/id_utils.ml b/parsing_cocci/id_utils.ml
index d7052dc..a121be9 100644
--- a/parsing_cocci/id_utils.ml
+++ b/parsing_cocci/id_utils.ml
@@ -19,7 +19,15 @@ let rec interpret dir exp =
let cmd =
Printf.sprintf "lid -f %s/%s -l %s -S newline"
dir !Flag_parsing_cocci.id_utils_index oo in
- Common.cmd_to_list cmd
+ (* lid puts the matched word at the beginning of the first line of
+ the output... *)
+ (match Common.cmd_to_list cmd with
+ [] -> []
+ | x::xs ->
+ (match Str.split (Str.regexp "[ \t]+") x with
+ [oop;file] when oo = oop ->
+ file :: xs
+ | _ -> failwith (Printf.sprintf "unexpected output of %s" cmd)))
| GC.And l ->
let rec loop = function
[] -> failwith "bad and"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-13 15:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 13:30 [Cocci] [bug] file not found with id-utils and include-headers Wolfram Sang
2013-10-13 15:47 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.