pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.252 2003/01/27 03:49:43 nilsson Exp $ + // $Id: master.pike.in,v 1.253 2003/01/27 04:01:05 nilsson Exp $      #pike __REAL_VERSION__      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif      // --- Some configurable parameters
pike.git/lib/master.pike.in:1666:    string format_paths() {    return ("master.pike...: " + (_master_file_name || __FILE__) + "\n"    "Module path...: " + pike_module_path*"\n"    " " + "\n"    "Include path..: " + pike_include_path*"\n"    " " + "\n"    "Program path..: " + pike_program_path*"\n"    " " + "\n");    };    +  mixed main_resolv(string ... syms) { +  mixed v = resolv(syms[0]); +  foreach(syms[1..], string sym) +  if(v) v = v[sym]; +  if(!v) +  _error("Could not resolv %s\n" +  "Is your PIKE_MODULE_PATH environment variable set correctly?\n", +  syms*"."); +  return v; +  }; +     if(sizeof(argv)>1 && sizeof(argv[1]) && argv[1][0]=='-')    { -  tmp=resolv("Getopt"); +  tmp = main_resolv( "Getopt" ); +     int NO_ARG = tmp->NO_ARG;    int MAY_HAVE_ARG = tmp->MAY_HAVE_ARG;    int HAS_ARG = tmp->HAS_ARG;    -  if (!tmp) -  _error("master.pike: Couldn't resolv Getopt module.\n" -  "Is your PIKE_MODULE_PATH environment variable set correctly?\n"); -  +     q=tmp->find_all_options(argv,({    ({"compat_version", HAS_ARG, ({"-V", "--compat"}), 0, 0}),    ({"version", NO_ARG, ({"-v", "--version"}), 0, 0}),    ({"help", NO_ARG, ({"-h", "--help"}), 0, 0}),    ({"features", NO_ARG, ({"--features"}), 0, 0}),    ({"info", NO_ARG, ({"--info"}), 0, 0}),    ({"execute", HAS_ARG, ({"-e", "--execute"}), 0, 0}),    ({"debug_without", HAS_ARG, ({"--debug-without"}), 0, 0}),    ({"preprocess", HAS_ARG, ({"-E", "--preprocess"}), 0, 0}),    ({"modpath", HAS_ARG, ({"-M", "--module-path"}), 0, 0}),
pike.git/lib/master.pike.in:1875:       case "preprocess":    write(cpp(master_read_file(opts[1]),opts[1]));    exit(0);    }    }       argv = tmp->get_args(argv,1);    }    -  mixed main_resolv(array syms) { -  mixed v = resolv(syms[0]); -  foreach(syms[1..], string sym) -  if(v) v = v[sym]; -  if(!v) -  _error("Could not resolv %s\n", syms*"."); -  return v; -  }; -  +    #ifdef __AUTO_BIGNUM__ -  // Load bignum support... -  { -  mixed v = resolv("Gmp.bignum"); -  if (!v) _error("Failed to load Gmp.bignum.\n"); -  } +  main_resolv( "Gmp", "bignum" );   #endif /* __AUTO_BIGNUM__ */       switch (postparseaction)    {    case "features": -  write( main_resolv( "Tools.Install.features"/"." )()*"\n"+"\n" ); +  write( main_resolv( "Tools", "Install", "features" )()*"\n"+"\n" );    exit(0);       case "info":    write("Software......Pike\n"    "Version......."+version()+"\n"    "WWW...........http://pike.ida.liu.se/\n"    "\n"    "pike binary..."+_pike_file_name+"\n"+    format_paths() + "\n"    "Features......"+ -  main_resolv( "Tools.Install.features"/"." )()*"\n "+ +  main_resolv( "Tools","Install","features" )()*"\n "+    "\n");    exit(0);    }       random_seed(time() ^ (getpid()<<8));       if(sizeof(argv)==1)    {    if(run_tool) {    werror("Pike -x specificed without tool name.\n"    "Available tools:\n");    mapping t = ([]);    int i; -  object ts = main_resolv(({ "Tools", "Standalone" })); +  object ts = main_resolv( "Tools", "Standalone" );    foreach(indices(ts), string s) {    object o = ts[s]();    if(!o->main) continue;    t[s] = o->description || "";    i = max(i, sizeof(s));    }    foreach(sort(indices(t)), string s)    werror(" %-"+i+"s %s\n", s, t[s]);    exit(1);    } -  main_resolv( ({ "Tools", "Hilfe" }) )->StdinHilfe(); +  main_resolv( "Tools", "Hilfe" )->StdinHilfe();    exit(0);    }    else    argv=argv[1..];       program prog;       if(run_tool) {    mixed err = catch { -  prog=main_resolv( ({ "Tools", "Standalone", argv[0] }) ); +  prog=main_resolv( "Tools", "Standalone", argv[0] );    };       if (err)    _error( "Pike: Failed to load tool %s:\n"    "%s\n", argv[0],    stringp(err[0])?err[0]:describe_backtrace(err) );       argv[0] = search(master()->programs, prog) || argv[0];    } else {    argv[0]=combine_path_with_cwd(argv[0]);