The header and the jamfile cache both normalize the paths of target files now. This should avoid that jamming from another directory invalidates teh cache due to differing relative paths.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6547 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2004-02-10 01:31:08 +00:00
parent 74c89bd7f8
commit 02f13c4aae
2 changed files with 16 additions and 4 deletions

View File

@ -348,10 +348,16 @@ hcache (TARGET *t, LIST *hdrscan)
{
HCACHEDATA cachedata, *c = &cachedata;
LIST *l = 0;
char _normalizedPath[PATH_MAX];
char *normalizedPath = normalize_path(t->boundname, _normalizedPath,
sizeof(_normalizedPath));
++queries;
c->boundname = t->boundname;
if (normalizedPath)
c->boundname = normalizedPath;
else
c->boundname = t->boundname;
if (hashcheck (hcachehash, (HASHDATA **) &c))
{

View File

@ -338,7 +338,7 @@ find_jcache_entry(jamfile_cache* cache, char* filename)
{
jcache_entry _entry;
jcache_entry* entry = &_entry;
entry->filename = filename;
entry->filename = filename;
if (!hashcheck(cache->entries, (HASHDATA**)&entry))
entry = 0;
return entry;
@ -624,12 +624,18 @@ jcache_done(void)
contents of the specified file, or 0, if an error occured.
*/
char**
jcache(char *filename)
jcache(char *_filename)
{
char** strings = 0;
jamfile_cache* cache = get_jcache();
// get file time
time_t time;
// normalize the filename
char _normalizedPath[PATH_MAX];
char *filename = normalize_path(_filename, _normalizedPath,
sizeof(_normalizedPath));
if (!filename)
filename = _filename;
// get file time
if (!cache)
return 0;
if (file_time(filename, &time) == 0) {