Branch: Tag:

2001-01-18

2001-01-18 10:38:03 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

backported INSTALLARGS, fakeroot and buildroot

Rev: bin/install.pike:1.68
Rev: lib/master.pike.in:1.118
Rev: src/Makefile.in:1.189

1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.117 2000/09/15 13:26:15 peter Exp $ +  * $Id: master.pike.in,v 1.118 2001/01/18 10:38:03 hubbe Exp $    *    * Master-file for Pike.    *
28:    * Functions begin here.    */    + #ifdef PIKE_FAKEROOT + object o; + string fakeroot(string s) + { +  string tmp1=combine_path_with_cwd(s); + #ifdef PIKE_FAKEROOT_OMIT +  foreach(PIKE_FAKEROOT_OMIT/":", string x) +  if(glob(x,tmp1)) +  return s; + #endif +  return PIKE_FAKEROOT+tmp1; + } + #else + #define fakeroot(X) X + #endif +    int is_absolute_path(string p)   {   #ifdef __NT__
120:   string master_read_file(string file)   {    object o=_static_modules.files()->Fd(); -  if(o->open(file,"r")) +  if(o->open(fakeroot(file),"r"))    return o->read();    return 0;   }
313:    }   #endif    -  if( (s=master_file_stat(fname)) && s[1]>=0 ) +  if( (s=master_file_stat(fakeroot(fname))) && s[1]>=0 )    {    AUTORELOAD_BEGIN();   
327:    case "":    case ".pike":    foreach(query_precompiled_names(fname), string oname) { -  if(array s2=master_file_stat(oname)) +  if(array s2=master_file_stat(fakeroot(oname)))    {    if(s2[1]>=0 && s2[3]>=s[3])    {
374:    werror(sprintf("low_find_prog(\"%s\", \"%s\") => load_module(\"\")\n"    "%s\n", pname, ext, describe_backtrace(backtrace())));    } -  ret=load_module(fname); +  ret=load_module(fakeroot(fname));   #endif /* load_module */    }   
612:    }       if( !files ) -  files = get_dir(dirname); +  files = get_dir(fakeroot(dirname));       int ret;    foreach( files, string s )
665:    }       if( !files ) -  files = get_dir(dirname); +  files = get_dir(fakeroot(dirname));    foreach(files, string fname) {    mixed err = catch {    if (((< ".pike", ".pmod" >)[fname[sizeof(fname)-5..]]) &&
800:    return o;    }    -  if(array stat=master_file_stat(fullname+".pmod")) +  if(array stat=master_file_stat(fakeroot(fullname+".pmod")))    {    if(stat[1]==-2)    return fc[fullname]=dirnode(fullname+".pmod");
810:    return fc[fullname]=o;      #if constant(load_module) -  if(master_file_stat(fullname+".so")) +  if(master_file_stat(fakeroot(fullname+".so")))    return fc[fullname]=low_cast_to_object(fullname,"/.");   #endif   
1272:    foreach(pike_include_path, path)    {    path=combine_path(path,f); -  if(master_file_stat(path)) +  if(master_file_stat(fakeroot(path)))    break;    else    path=0;