Agaric Design Collective

Setting up cscope for Drupal: the find command to list the files to index

Average: 5 (1 vote)
By Benjamin Melançon
on 22 Dec
0 comments

Description

Thanks to one of a whole slew of development environment tips from chx, Agaric is going to try to install and use cscope.

Installing cscope on a Mac with the fink package manager is as easy as typing on the command line:

fink install cscope

There is also a graphical interface for Fink called Fink Commander, I think.

Telling fink what to index is a little harder.

Chx wrote: "I keep a cscope.files in the Drupal directory listing all the .module, .inc, .php, .engine, .theme files and then cscope can quickly show me where a function is defined and where it is used."

For Agaric and probably a lot of other people we'll also need to exclude .svn directories. Our repository has drupal-core and drupal-contrib next to each other so it seems for the find command we would need to exclude the directories in our repository which we don't want to index, such as agaric-server and agaric-sites (we'll want to leave agaric-modules in though, for our modules-in-development, and likewise agaric-profiles).

In a bash or other shell script:

cd /
$REPOS = /path/to/repository
find  $REPOS
-path "$REPOS/agaric-sites*" -prune -o                                           \
-path "$REPOS/agaric-server*" -prune -o                                 \
        -name "*.[umWeDon'tKnowHowToDoThisYet]" -print >/home/jru/cscope/cscope.files

Maybe throw a line in there like "-path "$REPOS/*/.svn*" -prune -o" to exclude .svn directories, but I don't think that single asterisk cascades to deeper directories. However maybe dot-directories are already excluded.

 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.