pike.git / lib / modules / Local.pmod

version» Context lines:

pike.git/lib/modules/Local.pmod:1:   #pike __REAL_VERSION__    - // $Id: Local.pmod,v 1.6 2002/08/28 13:40:24 mikael Exp $ + // $Id: Local.pmod,v 1.7 2003/04/27 02:25:33 nilsson Exp $      //! @[Local] gives a local module namespace used for locally   //! installed pike modules. Modules are searched for in   //! the directory @tt{pike_modules@} which can be located in   //! the user's home directory or profile directory, or in any   //! of the system directories @tt{/opt/share, /usr/local/share,   //! /opt@} or @tt{/usr/local/@}. The user's home directory is   //! determined by examining the environment variable HOME, and   //! if that fails the environment variable USERPROFILE. If the   //! environment variable PIKE_LOCAL_PATH is set, the paths specified
pike.git/lib/modules/Local.pmod:19:   static array(string) local_path;      mixed `[](string name) {    // Make sure dot syntax Local.add_path works.    if(name=="add_path" || name=="remove_path"){    if(name=="add_path")    return add_path;    return remove_path;    }    -  // FIXME: Should .pike och .pmod files have priority? +  // FIXME: Should .pike or .pmod files have priority?    // currently .pike files has it here, but .pmod in the    // resolver. // mikael       foreach(local_path,string lp){    program r=(program)combine_path(lp,name);    if(r)    return r;    Stdio.Stat st;    if(st=file_stat(lp+name+".pmod")){    if(st->isdir)
pike.git/lib/modules/Local.pmod:66:   static void create() {    string tmp;    local_path=({ });    // FIXME $prefix/pike_modules    // FIXME All this should be controllable from .pikerc, when such a file is implemented...    add_path("/usr/local/pike_modules");    add_path("/opt/pike_modules");    add_path("/opt/share/pike_modules");    add_path("/usr/local/share/pike_modules");    -  if( (tmp=getenv("HOME")) || (tmp=getenv("USERPROFILE")) ) { +  if( (tmp=[string]getenv("HOME")) || (tmp=[string]getenv("USERPROFILE")) ) {    tmp = (tmp[-1]=='/'?tmp:tmp+"/")+"pike_modules/";    add_path(tmp);    }    -  if(tmp = getenv("PIKE_LOCAL_PATH") ) { +  if(tmp = [string]getenv("PIKE_LOCAL_PATH") ) {    array to_add=reverse(tmp/":"); // preserve order    add_path( to_add[*] );    }   }      //! This function prepends @[path] to the @[Local] module   //! searchpath.   //!   //! @param path   //! The path to the directory to be added.