Branch: Tag:

2002-08-28

2002-08-28 09:36:58 by Mikael Brandström <mikael@brandstrom.org>

Added support for specifying paths using the PIKE_LOCAL_PATH environment
variable.

Rev: lib/modules/Local.pmod:1.4

1:   #pike __REAL_VERSION__    - // $Id: Local.pmod,v 1.3 2002/02/25 13:13:27 nilsson Exp $ + // $Id: Local.pmod,v 1.4 2002/08/28 09:36:58 mikael Exp $      //! @[Local] gives a local module namespace used for locally   //! installed pike modules. Modules are searched for in
9:   //! 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 that fails the environment variable USERPROFILE. If the + //! environment variable PIKE_LOCAL_PATH is set, the paths specified + //! there will be searched first.   //! @seealso   //! @[Local.add_path()], @[Local.remove_path()]   //!
65:    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")) ) {    tmp = (tmp[-1]=='/'?tmp:tmp+"/")+"pike_modules/";    add_path(tmp);    } -  +  +  if(tmp = getenv("PIKE_LOCAL_PATH") ) { +  array to_add=tmp/":"; +  add_path( to_add[*] );    } -  + }      //! This function prepends @[path] to the @[Local] module   //! searchpath.