[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jan 13 02:20:23 2003 
Subject:New version of LIB make_indexes 
From:Aaron Sloman 
Volume-ID:1030113.05 


One of the things that happens by default when you re-link poplog using
the newpop command (help newpop) is running

    $popcom/make_indexes

It is also done by my install scripts.

This rebuilds the index files in help, ref, teach, and doc directories,
including adding cross references to other libraries.

It uses LIB MAKE_INDEX ( $usepop/pop/lib/lib/make_indexes.p ) described
in HELP make_indexes

However, if you have a circular file-structure (very easy with symbolic
links) that program can get itself into a mess.

I have produced a draft new version that avoids the problems because
(a) instead of looking at directories in the order in which
sys_file_match produces them (i.e. depth first search) it gets them
all and then sorts them by length, and also marks a directory if it
has already been dealt with to prevent repeated attempts to scan it.

I hope someone else will be willing to try it out before I make it
the default version. It's available here:

    http://www.cs.bham.ac.uk/research/poplog/lib/make_indexes.p

The crucial new procedure is get_all_subdirs, which replaces
locate_doc_dirs

It still needs some tidying up. I have only just realised that it could
probably have been made much simpler and faster by using sysfileinode
and storing inodes of visited directories, instead of creating a
temporary 'mark' file in each such directory.

I have not tried it with all the various arguments that are supposed
to work, but I found that the default version produced an error with
the '-strip' argument (which removes all ved's graphic characters
from all your documentation files, which makes life much easier for
emacs users), and I have not yet tried it with my version.
(replacing stripped files requires a complete re-installation!).


If you fetch my version of make_indexes.p, then then if you give
the command
    $popcom/makeindexes

while in the same directory, it will use the new version rather than the
library version.

If you don't like the result you can always run the system version
aftwards though to the best of my knowledge they produce the same
results in most cases, but in a different order.

Question for experts: what does sys_file_match, which produces a
repeater for path-names, do when you have a circular file structure and
give it the '/.../' form?

It does not go on forever, so I assume it is limited by the length of
some buffer or maximum path name?

As far as I can tell it does not include checks for circularity.
Doing that could be quite expensive in general.

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk   (ReadATas@please !)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/ (And free book on Philosophy of AI)
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html