pike.git / lib / modules / Tools.pmod / Standalone.pmod / dump.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/dump.pike:171:    ok = 1;    break do_dump;    }    }    rm(fakeroot(outfile)+".o"); // Make sure no old files are left       if (s->isdir && recursive) {    if (array(string) dirlist = get_dir (fakeroot (file))) {    if (!quiet) logmsg ("Is a directory (dumping recursively).\n");    foreach (dirlist, string subfile) -  if (subfile != "CVS" && -  (has_suffix (subfile, ".pike") || +  if (has_suffix (subfile, ".pike") ||    has_suffix (subfile, ".pmod") || -  Stdio.is_dir (file + "/" + subfile))) +  Stdio.is_dir (file + "/" + subfile))    if (!dumpit (combine_path (file, subfile),    combine_path (outfile, subfile)))    return 0;    ok = 1;    break do_dump;    }    else { -  logmsg ("Is an unreadable directory (not dumped recursively): %s.\n", -  strerror (errno())); +  logmsg("Is an unreadable directory (not dumped recursively): %s.\n", +  strerror(errno()));    break do_dump;    }    }    else if (!s->isreg)    {    logmsg("Is a directory or special file (not dumped).\n");    break do_dump;    }    }else{    if(!quiet) logmsg("Does not exist (not dumped).\n");
pike.git/lib/modules/Tools.pmod/Standalone.pmod/dump.pike:223:    // werror("\n------------------------\n\n");    p=([function](mixed)decode_value)(s, master()->Decoder(), @debug_level);    }))    logmsg_long(describe_backtrace(err));       else if(programp(p))    {    string dir = combine_path (outfile, "..");    if (!Stdio.is_dir (fakeroot(dir)))    if (!Stdio.mkdirhier (fakeroot(dir))) { -  logmsg ("Failed to create target directory %O: %s.\n", -  dir, strerror (errno())); +  logmsg ("Failed to create target directory %O: %s.\n", dir, +  strerror(errno()));    break do_dump;    }       Stdio.write_file(fakeroot(outfile)+".o",s);    ok = 1;    if(!quiet) logmsg("Dumped.\n");    }       else if(!quiet)    logmsg("Decode of %O failed (not dumped).\n", file);
pike.git/lib/modules/Tools.pmod/Standalone.pmod/dump.pike:247:    else {    ok = 1; // Don't count this as a failure.    if(!quiet)    logmsg("Not dumped due to %s constant.\n",    p->dont_dump_module ? "dont_dump_module" :    p->dont_dump_program ? "dont_dump_program" :    "this_program_does_not_exist");    }    }    +  else if (arrayp(err) && err[0] == "Required feature missing.\n") { +  ok = 1; // Don't count this as a failure. +  if(!quiet) +  logmsg("Not dumped due to missing feature.\n"); +  } +     else {    // This should never happen. If it does then it's not safe to    // continue dumping since later modules might do #if constant(...)    // on something for modifiers in this one and would then be dumped    // incorrectly without errors.    if (err && (!objectp (err) || !err->is_compilation_error || !err->is_cpp_error))    // compile() should never throw any other error, but we play safe.    logmsg_long("Compilation of %O failed (not dumped):\n%s",    file, describe_backtrace(err));    else
pike.git/lib/modules/Tools.pmod/Standalone.pmod/dump.pike:312:      void setup_logging(void|string file) {    logfile = Stdio.File(stringp(file) && file || "dumpmodule.log",    "caw");    /* Redirect all debug and error messages to the logfile. */    logfile->dup2(Stdio.stderr);   }      int pos;   array files; + int result;      void dump_files() {       if(pos>=sizeof(files)) {    if (update_stamp)    Stdio.write_file (update_stamp, version()); -  exit(0); +  exit(result);    }      #if constant(alarm)    // Dumping shouldn't take more than a minute per file.    alarm(60);   #endif       string file = files[pos++];       if(progress_bar)    progress_bar->update(1);       string outfile = file;    if (target_dir) {   #ifdef __NT__    outfile = replace (outfile, "\\", "/");   #endif    outfile = combine_path (target_dir, ((outfile / "/") - ({""}))[-1]);    }    -  if (!dumpit(file, outfile) && !nt_install) +  if (!dumpit(file, outfile) && !nt_install) { +  result = 1;    pos = sizeof(files); // exit -  +  }      #if constant(alarm)    alarm(0);   #endif    call_out(dump_files, 0);   }      int main(int argc, array(string) argv)   {    replace_master (MyMaster());