pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.176 2001/11/09 14:06:49 mast Exp $ +  * $Id: master.pike.in,v 1.177 2001/11/12 13:38:04 mast Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:881:    if(!zero_type(o=module[index]))    {   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) module[%O] -> %O\n",sizeof(backtrace()),dirname,index, o);   #endif    return o;    }    }       if( !files ) -  files = get_dir(fakeroot(dirname)); +  if (!(files = get_dir(fakeroot(dirname)))) { +  werror ("Error listing module directory %O: %s\n", +  dirname, strerror (errno())); +  files = ({}); +  }       int ret;    foreach( files, string s )    {    if( search(s, index)!=-1 || search(index,s)!=-1 )    {    ret=1;    break;    }    }
pike.git/lib/master.pike.in:955:    return;    }       if (module) {    foreach(indices(module), string index) {    cache[index] = module[index];    }    }       if( !files ) -  files = get_dir(fakeroot(dirname)); +  if (!(files = get_dir(fakeroot(dirname)))) { +  werror ("Error listing module directory %O: %s\n", +  dirname, strerror (errno())); +  files = ({}); +  } +     foreach(files, string fname) {    mixed err = catch {    if (((< ".pike", ".pmod" >)[fname[sizeof(fname)-5..]]) &&    !zero_type(`[](fname[..sizeof(fname)-6]))) {    continue;    } else if ((fname[sizeof(fname)-3..] == ".so") &&    !zero_type(`[](fname[..sizeof(fname)-4]))) {    continue;    }    };
pike.git/lib/master.pike.in:2272:   //!   //! The argument @[trace] should normally be the return value from a call   //! to @[backtrace()], or a caught error.   //!   //! @seealso   //! @[backtrace()], @[describe_error()], @[catch()], @[throw()]   //!   string describe_backtrace(mixed trace, void|int linewidth)   {    int e; -  string ret; +  string ret = "";    int backtrace_len=((int)getenv("PIKE_BACKTRACE_LEN")) || bt_max_string_len;       if(!linewidth)    {    linewidth=99999;    catch    {    linewidth=_static_modules.files()->_stdin->tcgetattr()->columns;    };    if(linewidth<10) linewidth=99999;
pike.git/lib/master.pike.in:2294:       if((arrayp(trace) && sizeof(trace)==2 && stringp(trace[0])) ||    (objectp(trace) && trace->is_generic_error))    {    if (catch {    ret = trace[0] || "No error message!\n";    trace = trace[1];    }) {    return "Error indexing backtrace!\n";    } -  }else{ -  ret=""; -  } -  +     if(!arrayp(trace)) -  +  return ret + "No backtrace.\n"; +  }else +  if (!arrayp (trace)) +  return sprintf ("Unrecognized backtrace format: %O\n", trace); +     { -  ret+="No backtrace.\n"; -  }else{ +     Describer desc = Describer();    desc->identify_parts (trace);       int end = 0;    if( (sizeof(trace)>1) &&    arrayp(trace[0]) &&    (sizeof(trace[0]) > 2) &&    (trace[0][2] == _main))    end = 1;   
pike.git/lib/master.pike.in:2444:    sprintf("... last %d frames above repeated %d times ...\n",    -loop_start, loops)    });    }    frames += tail;    }       ret += frames * "";    }    -  return ret || "No backtrace!\n";; +  return ret;   }      //! @appears describe_error   //! Returns only the error message from a backtrace.   //!   //! If there is no error message in the backtrace, a fallback message   //! will be returned.   //!   //! @seealso   //! @[backtrace()], @[describe_backtrace()]
pike.git/lib/master.pike.in:2616:    Version v=Version(major,minor);       if(v > currentversion)    {    /* do we want to make an error if major.minor > __MAJOR__.__MINOR ? */    return 0;    }       if(!zero_type(ret=compat_handler_cache[v])) return ret;    +  array files;    array(Version) available=({});      #if "¤share_prefix¤"[0]!='¤' -  foreach(get_dir("¤share_prefix¤"), string ver) +  if (!(files = get_dir("¤share_prefix¤"))) { +  werror ("Error listing directory %O: %s\n", +  "¤share_prefix¤", strerror (errno())); +  files = ({}); +  } +  foreach(files, string ver)    {    if(sscanf(ver,"%d.%d",int maj, int min))    {    Version x=Version(maj, min) ;    if(x >= v)    available|=({ x });    }    }   #endif      #if "¤lib_prefix¤"[0]!='¤' -  foreach(get_dir("¤lib_prefix¤"), string ver) +  if (!(files = get_dir("¤lib_prefix¤"))) { +  werror ("Error listing directory %O: %s\n", +  "¤lib_prefix¤", strerror (errno())); +  files = ({}); +  } +  foreach(files, string ver)    {    if(sscanf(ver,"%d.%d",int maj, int min))    {    Version x=Version(maj, min) ;    if(x >= v)    available|=({ x });    }    }   #endif