Re: [Tracker] [Patch] Correct locales support



Laurent Aguerreche wrote:


This is the patch.

* many g_filename_to_utf8() or g_locale_to_utf8() added;
* setlocale(LC_ALL, "") added to get a working g_get_charset() in any
program;
* some g_utf8_validate() removed when g_locale_to_utf8() or
g_filename_to_utf8() need to be called;
* some code refactoring in clients;
* some headers removed or added in clients...;
* realpath(path,NULL) instead of realpath(path,tmp) in clients because
some systems are not limited with deep of directories. NULL handling is
a GNU extension.
* in tracker-extract.c, there were lines like:
   EXTRACTOR_removeEmptyKeywords (keywords);
  but this function modify keywords list and send a new one! So it needs
to be use that way:
   keywords = EXTRACTOR_removeEmptyKeywords (keywords);
* stat() => g_stat(), lstat() => g_lstat()
* some tests removed:

char **foo;
for (foo = bar; *foo; foo++) {
   if (*foo) {   /* it is always true... */
     ...
   }
}



okay this is great - thanks for your hard work here and for cleaning up some of the mess!

just one thing : do we really need the setlocale (LC_ALL, ""); stuff?

If we are converting to/from utf-8 then we should not need these, surely?



Now Tracker seems to fully work on non UTF-8 systems but FAM backend has
some problems:
- let it index and all your files and extract metadata;
- then do something like:
  $ echo 'foo' > bar
- fam_callback() is called but I can only see plenty of lines:

tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
etc.

and it never stops... Is is amazing to see that this bug doesn't happen
if I add breakpoints into fam_callback() and then run it in gdb...


this is probably my fault as I changed the way stuff is sync'ed without testing the FAM backend. We should always call tracker_db_remove_pending_files before sleeping (and this is why when you put a breakpoint you wont see the error cause the 100ms sleep will be faster than you stepping thro the code!)

try changing this in trackerd.c, in function process_files_thread so tracker_db_remove_pending_files is always called prior to sleeping:

/* pending files are present but not yet ready as we are waiting til they stabilize so we should sleep for 100ms (only occurs when using FAM) */
                        tracker_db_remove_pending_files (db_con);

                        if (k == 0) {
                                g_usleep (100000);
                        }



Again thanks for the patch, I will need some time to look over it more closely so will get back to you in a day or two...


--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]