Re: [Ekiga-devel-list] HEAD has issues...



Julien PUYDT a écrit :
Craig Southeren a écrit :

It could be the plugin code looking for plugins, if the PWLIBPLUGINDIR
environment variable is set weirdly

I think it's the plugin code

Here it is, from src/ptlib/common/pluginmgr.cxx :

PStringArray PPluginManager::GetPluginDirs()
{
  PString env = ::getenv(ENV_PWLIB_PLUGIN_DIR);
  if (env == NULL) {
    // env = P_DEFAULT_PLUGIN_DIR;
    PString execDir = PProcess::Current().GetFile();
    PINDEX sepLoc = execDir.FindLast(PDIR_SEPARATOR);
    if(sepLoc != P_MAX_INDEX){
        execDir = execDir.Left(sepLoc);
    }
    env = execDir + DIR_SEP + P_DEFAULT_PLUGIN_DIR;
  }

  // split into directories on correct seperator
  return env.Tokenise(DIR_SEP, TRUE);
}

This means :
- if I don't have ENV_PWLIB_PLUGIN_DIR set ;
- then he code used to be searching P_DEFAULT_PLUGIN_DIR (but it's now commented out ; - the current code checks from where we were run, and adds P_DEFAULT_PLUGIN_DIR to it.

What is P_DEFAULT_PLUGIN_DIR, then ? In the same file, I find :
define P_DEFAULT_PLUGIN_DIR ".:/usr/lib/pwlib"

So what happens is that in my case env becomes :
/home/jpuydt/.:/usr/lib/pwlib
when I launch from a menu, which will search in all my home directory.

I can get away of course by doing:
mkdir toto
cd toto
ekiga
because in that case, I'll end up with env being /something/toto/.:/usr/lib/pwlib

Let me try to make a list of problems in the code :
- GetPluginDirs assumes P_DEFAULT_PLUGIN_DIR is a single token (wrong in my case : I have two tokens) ; - GetPluginDirs assumes P_DEFAULT_PLUGIN_DIR is not a directory in itself, but a directory layout precision (wrong in my case : one of them could indeed be a directory layout precision, but the other is an absolute path) ; - GetPluginDirs assumes the exec directory is of importance to find the plugins ; which is partially wrong : it should in fact try to find my home directory, and in such a case look in .pwlib/plugins or something like this.

Snark



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