pcb

Comment 3 for bug 1005644

Revision history for this message
Jeff Mallatt (jjm-j) wrote : Re: [Bug 1005644] Re: Added "pcbignore" to ignore newlib dirs/files

At 2012-08-06 07:07, you wrote:
>Hi Jeff,
>
>Good idea ;-)

Thanks.

>I have tested this patch in my local git repo
><https://github.com/bert/pcb/tree/LP1005644>.

And thanks for testing the patch!

Also, sorry for not responding sooner -- my development environment blew up, and I needed to re-construct it before I could refresh my memory and make sure things were working as I thought.

>Copying .gitignore to .pcbignore in the toplevel pcb dir and the newlib
>dir doesn't seem to give the expected results.

The format and meaning of pcbignore files is different from gitignore or cvsignore files. It only understands three things: "!" to clear the list; filename globs (e.g. "*.foo", "GNUmakefile"); and directory names (marked by leading "/"; only applicable to the root directory of newlib-style directory trees; e.g. "/unreleased").

Also the location(s) where it is looked for is more restricted.

A pcbignore file in "~/.pcb/pcbignore" applies equally to every newlib-style root directory and their immediate subdirectories. Then each of those newlib-style root directories and subdirectories may have a ".pcbignore" file in them, and that ".pcbignore" applies to only that directory or subdirectory. There is no "searching up the tree"... At least, not yet -- I now think that this would be a good idea, and I'll add it to the next version of the patch.

>For example, when choosing "File"->"Open" still shows the Makefile and
>Makefile.in etc. in both above mentioned dirs.
>
>Also for choosing "File"->"Load element to buffer".

And pcbignore only applies to the newlib "PCB Library" Window.

I don't really know much about this aspect of the PCB code, but when it comes to File menu operations, doesn't that depend upon which HID is used? That's in a very different area of the code. E.g. it looks like the GTK HID would need src/hid/gtk/gui-dialog.c to be modified, and then it could do only those things that the GTK library could do. This is another area that could be looked into, but I'm not sure that the pcbignore idea would work here.

>I have verified in config.h that:
>
><quote>
>/* Define to 1 if you have the `fnmatch' function. */
>#define HAVE_FNMATCH 1
></quote>
>
>is set so that no "hard-coded internal fakery" is performed.

Okay, good.

>Maybe I have misunderstood the documentation or maybe the patch is not
>complete.

The patch is complete in that it does what I intended. That does not mean that the patch can't be extended to do more than it currently does. :-)

>And maybe add a more extensive explanation of these rules in the
>documentation.

No doubt that is always true. :-)

I'll extend it in the next version of the patch.

So I'll add searching up the directory tree for .pcbignore files, and I'll try to improve/extend the documentation, and then re-post a patch to Launchpad, and send a message to the geda-user mailing list. Should be within a few days. If you have any other comments or suggestions before then, just let me know.

Thanks!