Bugs item #518365, was opened at 2002-02-16 02:04
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=390117&aid=518365&group_id=27350
Category: genxref
Group: v0.9
Status: Open
Resolution: None
Priority: 5
Submitted By: Shree Kumar (shreekumar)
Assigned to: Nobody/Anonymous (nobody)
Summary: Indexing of files once indexed is buggy!
Initial Comment:
I am using LXR-0.9.1
Consider this scenario :
There is a source tree "test" having only one file - test.c
test.c
-------
#define TEST 100
now, I run genxref & when I search for TEST in identifiers, I get that it is a macro defined in
test.c at line 1
now I change test.c to
-------
#define T 1
#define TEST 100
& run genxref
Now what I get is - TEST is defined as a macro in test.c in line 1 and line 2 !
The culprit is this piece of code in function processfile() [ Tagger.pm ]
------
if ($index->toindex($fileid)) {
$index->empty_cache();
print(STDERR "--- $pathname $fileid\n");
my $path = $files->tmpfile($pathname, $release);
$lang->indexfile($pathname, $path, $fileid, $index, $config);
unlink($path);
} else {
print(STDERR "$pathname was already indexed\n");
}
------
The problem is that if the file already existed and has changed since then [based on the
timestamp], the identifiers added to the database due to this file in the previous run of genxref are
not removed from the database, hence the number of definitions will keep on growing...
The same problem is also present in processrefs().
----------------------------------------------------------------------
>Comment By: Shree Kumar (shreekumar)
Date: 2002-02-16 05:32
Message:
Logged In: YES
user_id=142912
There are two cases where the scenario that I've referred to applies:
1. Files are not in CVS [ ie usage of "Files.pm" ]. You run genxref, then change a file & genxref again
2. Files are in CVS, and you want to index the "head" tag. Files change regularly, and you want to keep the
cross reference in sync - probably by running genxref once an hour or so [as a cron job].
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2002-02-16 04:47
Message:
Logged In: NO
I was in the impression that a file may never ever change again, except if (and only if) the file was changed and has either got a new CVS revision (or tag) or if there is a new directory for a new version of the whole project (if it is not managed by CVS).
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=390117&aid=518365&group_id=27350