Hello community, here is the log from the commit of package coccigrep for openSUSE:Factory checked in at 2013-08-25 13:36:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/coccigrep (Old) and /work/SRC/openSUSE:Factory/.coccigrep.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "coccigrep" Changes: -------- --- /work/SRC/openSUSE:Factory/coccigrep/coccigrep.changes 2012-12-31 14:24:54.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.coccigrep.new/coccigrep.changes 2013-08-25 13:36:10.000000000 +0200 @@ -1,0 +2,6 @@ +Sat Aug 17 19:40:33 UTC 2013 - jslaby@suse.com + +- update to latest snapshot (20130723) + * see ChangeLog for changes + +------------------------------------------------------------------- Old: ---- coccigrep-20121222.tar.xz New: ---- coccigrep-20130723.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ coccigrep.spec ++++++ --- /var/tmp/diff_new_pack.UkKn0F/_old 2013-08-25 13:36:10.000000000 +0200 +++ /var/tmp/diff_new_pack.UkKn0F/_new 2013-08-25 13:36:10.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package coccigrep # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: coccigrep -Version: 20121222 +Version: 20130723 Release: 0 Summary: Semantic grep tool for C, based on coccinelle License: GPL-3.0 ++++++ coccigrep-20121222.tar.xz -> coccigrep-20130723.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccigrep-20121222/README.rst new/coccigrep-20130723/README.rst --- old/coccigrep-20121222/README.rst 2012-12-31 12:40:07.000000000 +0100 +++ new/coccigrep-20130723/README.rst 2013-08-17 21:40:17.000000000 +0200 @@ -18,7 +18,7 @@ Examples ======== -To find where in a set of files the structure named `Packet` is used, you +To find where in a set of files the type named `Packet` is used, you can run :: $ coccigrep -t Packet *c @@ -26,6 +26,14 @@ source-af-packet.c:300: p->datalink = ptv->datalink; source-af-packet.c:758: switch(p->datalink) { +If you want to match on structure, you need to provide the complete name :: + + coccigrep -t 'struct seq_file' fs/seq_file.c + fs/seq_file.c:654 (struct seq_file *seq): seq = f->private_data; + fs/seq_file.c:655 (struct seq_file *seq): seq->private = private; + fs/seq_file.c:537 (struct seq_file *m): if (m->count < m->size) { + + To find where in a set of files the `datalink` attribute is used in the structure named `Packet`, you can simply do :: @@ -42,6 +50,52 @@ source-af-packet.c:300: p->datalink = ptv->datalink; source-erf-dag.c:525: p->datalink = LINKTYPE_ETHERNET; +Installation +============ + +The dependencies of coccigrep are spatch which comes with coccinelle. On python side, you +need setuptools and optionally pygments (for colorized output). Happy Debian user can do :: + + aptitude install python-setuptools python-pygments + +To install coccigrep run :: + + sudo python ./setup.py install + +Configuration +============= + +As from version 0.8, coccigrep can be configured via a configuration file. A complete sample of +configuration file is available in the src/coccinelle.cfg. + +Hierarchical configuration +-------------------------- + +The configuration file system is hierarchical and the following files are parsed in that order + + - host config in /etc/coccigrep + - user config in ~/.coccigrep + - directory config in .coccigrep + +Thus, for example, the directory config settings will overwrite host config settings. + +Interesting options +------------------- + +In the global section, the `concurrency_level` is the most interesting. It codes the number of +spatch commands that will be launched in parallel. If multiple files are search, this will +increase dramatically performances at the cost of a little increase of memory usage. + +If you want to add your own semantic patches, you just have to put them in a directory with +name matchting the wanted operation name (`zeroed.cocci` will lead to the `zeroed` operation). +Then add a `local_cocci_dir` pointing to this directory in the global section. + +For a description of the writing of semantic patches see `coccigrep homepage`_. + +.. _coccigrep homepage: http://home.regit.org/software/coccigrep/ + +Other options are more explicit and are direct mapping of the associated command line option. + Running coccigrep in vim ------------------------ @@ -99,45 +153,3 @@ The matches will appear in a buffer with mode set to `grep-mode` and you will thus be able to jump on occurence. History is available on the different parameters. - - -Installation -============ - -To install coccigrep run :: - - sudo python ./setup.py install - -Configuration -============= - -As from version 0.8, coccigrep can be configured via a configuration file. A complete sample of -configuration file is available in the src/coccinelle.cfg. - -Hierarchical configuration --------------------------- - -The configuration file system is hierarchical and the following files are parsed in that order - - - host config in /etc/coccigrep - - user config in ~/.coccigrep - - directory config in .coccigrep - -Thus, for example, the directory config settings will overwrite host config settings. - -Interesting options -------------------- - -In the global section, the `concurrency_level` is the most interesting. It codes the number of -spatch commands that will be launched in parallel. If multiple files are search, this will -increase dramatically performances at the cost of a little increase of memory usage. - -If you want to add your own semantic patches, you just have to put them in a directory with -name matchting the wanted operation name (`zeroed.cocci` will lead to the `zeroed` operation). -Then add a `local_cocci_dir` pointing to this directory in the global section. - -For a description of the writing of semantic patches see `coccigrep homepage`_. - -.. _coccigrep homepage: http://home.regit.org/software/coccigrep/ - -Other options are more explicit and are direct mapping of the associated command line option. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/coccigrep-20121222/src/coccigrep.py new/coccigrep-20130723/src/coccigrep.py --- old/coccigrep-20121222/src/coccigrep.py 2012-12-31 12:40:07.000000000 +0100 +++ new/coccigrep-20130723/src/coccigrep.py 2013-08-17 21:40:17.000000000 +0200 @@ -405,7 +405,7 @@ self.verbose = True def get_spatch_version(self): - cmd = [self.spatch] + [ '--version'] + cmd = [self.spatch] + [ '-version'] try: output = Popen(cmd, stderr=PIPE).communicate()[1] except OSError, err: -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org