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.333 2004/02/08 16:03:13 grubba Exp $ + // $Id: master.pike.in,v 1.334 2004/02/27 13:08:23 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:2198:    if(a=="") {    sscanf(b, "%s=%s", a, b);    a="="+a;    }   #endif    putenv(a, b);    }    else    werror("Broken environment var %s\n",a);    -  void _error(string a, mixed ... b) { -  werror(a, @b); -  exit(1); -  }; -  -  +    #ifndef NOT_INSTALLED    {    array parts = (getenv("PIKE_INCLUDE_PATH")||"")/PATH_SEPARATOR-({""});    int i = sizeof(parts);    while(i) add_include_path(parts[--i]);       parts = (getenv("PIKE_PROGRAM_PATH")||"")/PATH_SEPARATOR-({""});    i = sizeof(parts);    while(i) add_program_path(parts[--i]);   
pike.git/lib/master.pike.in:2231:    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]; +  mixed main_resolv(string sym) { +  mixed v = resolv(sym);    if(!v) -  _error("Could not resolv %s. (Perhaps the installed pike tree has been moved.)\n", -  syms*"."); +  error("Could not resolv %s. " +  "(Perhaps the installed pike tree has been moved.)\n", sym);    return v;    };       if(sizeof(argv)>1 && sizeof(argv[1]) && argv[1][0]=='-')    {    array q;    tmp = main_resolv( "Getopt" );       int NO_ARG = tmp->NO_ARG;    int MAY_HAVE_ARG = tmp->MAY_HAVE_ARG;
pike.git/lib/master.pike.in:2393:    exit(0);       case "version":    werror(version() + " Copyright © 1994-2004 Linköping University\n"    "Pike comes with ABSOLUTELY NO WARRANTY; This is free software and you are\n"    "welcome to redistribute it under certain conditions; Read the files\n"    "COPYING and COPYRIGHT in the Pike distribution for more details.\n");    exit(0);       case "help": -  werror( main_resolv("Tools","MasterHelp")->do_help(opts[1]) ); +  werror( main_resolv("Tools.MasterHelp")->do_help(opts[1]) );    exit(0);       case "features":    postparseaction="features";    break;       case "info":    postparseaction="info";    break;       case "showpaths":    werror(format_paths());    exit(0);       case "execute":   #ifdef __AUTO_BIGNUM__ -  main_resolv( "Gmp", "bignum" ); +  main_resolv( "Gmp.bignum" );   #endif /* __AUTO_BIGNUM__ */       random_seed((time() ^ (getpid()<<8)));    argv = tmp->get_args(argv,1);       program prog;    if(Version(compat_major,compat_minor) <= Version(7,4))    prog = compile_string(    "mixed create(int argc, array(string) argv,array(string) env){"+    opts[1]+";}");
pike.git/lib/master.pike.in:2458:    }    if(stringp(ret)) {    write(ret);    if(ret[-1]!='\n') write("\n");    }    if(!intp(ret) || ret<0) ret=0;    exit(ret);       case "preprocess":   #ifdef __AUTO_BIGNUM__ -  main_resolv( "Gmp", "bignum" ); +  main_resolv( "Gmp.bignum" );   #endif /* __AUTO_BIGNUM__ */    write(cpp(master_read_file(opts[1]),opts[1]));    exit(0);    }    }       argv = tmp->get_args(argv,1);    }       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);    }      #ifdef __AUTO_BIGNUM__ -  main_resolv( "Gmp", "bignum" ); +  main_resolv( "Gmp.bignum" );   #endif /* __AUTO_BIGNUM__ */       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) {    mixed val = ts[s];    if (programp (val)) {    object o = val();    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" +  error( "Pike: Failed to load tool %s:\n"    "%s\n", argv[0],    stringp(err[0])?err[0]:describe_backtrace(err) );       argv[0] = search(programs, prog) || argv[0];    } else {    argv[0]=combine_path_with_cwd(argv[0]);       mixed err = catch {    prog=(program)argv[0];    };       if (err) -  _error( "Pike: Failed to compile script:\n" +  error( "Pike: Failed to compile script:\n"    "%s\n", stringp(err[0])?err[0]:describe_backtrace(err) );    }       if(!prog) -  _error("Pike: Couldn't find script to execute\n(%O)\n", argv[0]); +  error("Pike: Couldn't find script to execute\n(%O)\n", argv[0]);      #if constant(_debug)    if(debug) _debug(debug);   #endif    if(trace) trace = predef::trace(trace);    mixed ret;    mixed err = catch {    // The main reason for this catch is actually to get a new call    // to eval_instruction in interpret.c so that the debug and    // trace levels set above take effect in the bytecode evaluator.    object script;    if(Version(compat_major,compat_minor) <= Version(7,4)) {    script=prog();    }    else {    script=prog(argv);    }    if(!script->main) -  _error("Error: %s has no main().\n", argv[0]); +  error("Error: %s has no main().\n", argv[0]);    ret=script->main(sizeof(argv),argv,env);    };    // Disable traceing.    trace = predef::trace(trace);    if (err) {    handle_error (err);    ret = 10;    }    if(!intp(ret)) {    werror("Error: Non-integer value %O returned from main.\n", ret);