summaryrefslogtreecommitdiff
path: root/src/bin/e_module.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-24 08:16:10 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-24 08:16:10 +0000
commit47162b2c2acd1858ba5f54a11985f19953639f40 (patch)
tree8afd3f1862e89d039aad28325ae886d62d78aef1 /src/bin/e_module.c
parente1b795a895e1b011d90fbd255ae8a939fd1d7386 (diff)
downloadenlightenment-47162b2c2acd1858ba5f54a11985f19953639f40.tar.gz
module loading now enforces priority for user directories; at some point we should probably figure out how to set up a priority list for /usr/lib vs /usr/local/lib and such
SVN revision: 83206
Diffstat (limited to 'src/bin/e_module.c')
-rw-r--r--src/bin/e_module.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 77d5d8691b..3941dc4c74 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -46,13 +46,22 @@ _module_filter_cb(void *d EINA_UNUSED, Eio_File *ls EINA_UNUSED, const Eina_File
}
static void
-_module_main_cb(void *d EINA_UNUSED, Eio_File *ls EINA_UNUSED, const Eina_File_Direct_Info *info)
+_module_main_cb(void *d, Eio_File *ls EINA_UNUSED, const Eina_File_Direct_Info *info)
{
Eina_Stringshare *s;
s = eina_hash_set(_e_module_path_hash, info->path + info->name_start, eina_stringshare_add(info->path));
if (!s) return;
- WRN("REPLACING DUPLICATE MODULE PATH: %s -> %s", s, info->path);
+ if (!d)
+ {
+ if (!strstr(s, e_user_dir_get()))
+ INF("REPLACING DUPLICATE MODULE PATH: %s -> %s", s, info->path);
+ else
+ {
+ INF("NOT REPLACING DUPLICATE MODULE PATH: %s -X> %s", s, info->path);
+ s = eina_hash_set(_e_module_path_hash, info->path + info->name_start, s);
+ }
+ }
eina_stringshare_del(s);
}
@@ -73,15 +82,24 @@ _module_error_cb(void *d EINA_UNUSED, Eio_File *ls, int error EINA_UNUSED)
}
static Eina_Bool
-_module_monitor_dir_create(void *d EINA_UNUSED, int type EINA_UNUSED, Eio_Monitor_Event *ev)
+_module_monitor_dir_create(void *d, int type EINA_UNUSED, Eio_Monitor_Event *ev)
{
Eina_Stringshare *s;
const char *path;
path = ecore_file_file_get(ev->filename);
s = eina_hash_set(_e_module_path_hash, path, eina_stringshare_ref(ev->filename));
- if (s && (s != ev->filename))
- WRN("REPLACING DUPLICATE MODULE PATH: %s -> %s", s, ev->filename);
+ if (!s) return ECORE_CALLBACK_RENEW;
+ if ((!d) && (s != ev->filename))
+ {
+ if (!strstr(s, e_user_dir_get()))
+ INF("REPLACING DUPLICATE MODULE PATH: %s -> %s", s, ev->filename);
+ else
+ {
+ INF("NOT REPLACING DUPLICATE MODULE PATH: %s -X> %s", s, ev->filename);
+ s = eina_hash_set(_e_module_path_hash, path, s);
+ }
+ }
eina_stringshare_del(s);
return ECORE_CALLBACK_RENEW;
@@ -130,9 +148,11 @@ e_module_init(void)
{
Eio_Monitor *mon;
Eio_File *ls;
+ void *data = NULL;
mon = eio_monitor_stringshared_add(epd->dir);
- ls = eio_file_direct_ls(epd->dir, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, NULL);
+ data = (intptr_t*)(long)!!strstr(epd->dir, e_user_dir_get());
+ ls = eio_file_direct_ls(epd->dir, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, data);
_e_module_path_monitors = eina_list_append(_e_module_path_monitors, mon);
_e_module_path_lists = eina_list_append(_e_module_path_lists, ls);
eina_stringshare_del(epd->dir);