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

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike:1:      #pike __REAL_VERSION__    - int DEBUG=1; + int pmar_debug=1;      constant version =    sprintf("%d.%d.%d",(int)__REAL_VERSION__,__REAL_MINOR__,__REAL_BUILD__);   constant description = "Pike packaged module (PMAR) installer.";      int forcing;   int ilocal;      string md5; // the optional md5 checksum to compare the package against.   string s; // the pmar file contents
pike.git/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike:264:    //    if(restart)    {    write("Restarting installation process.\n");    }    else    {    array(string) comp = ({});    foreach(metadata->MODULE/",";;string mod)    { -  mod = String.trim_all_whites(mod); +  mod = String.trim(mod);    write("Uninstalling any previous version of %s...\n", mod);       // we spawn a new pike to do this because Windows prohibits modifying a file if it's already    // in use, and the act of querying a module's existance will cause any .so files to be tied    // up for the duration of the process lifetime.       object d = Tools.Monger.MongerUser();    string local_ver;    array local_components;   
pike.git/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike:478:    array files = t->get_dir();    int c;    foreach(sort(files), string fname) {    // Get the actual filename    fname = ((fname / "/") - ({""}))[-1];    object stat = t->cd(cwd)->stat(fname);    if (stat->isdir) {    string dir = Stdio.append_path(path, fname);    c++;    cc++; -  if (DEBUG) +  if (pmar_debug)    write(sprintf("creating: %s [dir]\n", dir));    mkdir(dir);    c += untar(source, dir, Stdio.append_path(cwd, fname));    }    else if (stat->isreg) {    string file = Stdio.append_path(path, fname);    if (mixed err = catch{ -  if (DEBUG) +  if (pmar_debug)    write("writing: %s [file %d bytes]\n", file, stat->size);    Stdio.write_file(file, t->cd(cwd)->open(fname, "r")->read());    }) {    werror("failed: %s [error writing file]\n\n", file);    throw(err);    }    c++;    cc++;    }    else {
pike.git/lib/modules/Tools.pmod/Standalone.pmod/pmar_install.pike:542:    fn = md5hash((string)random(1000) + filename + " " + (string)time());    path = combine_path(dir , fn);       Stdio.write_file(path, data);   // write("Temp file: " + path + "\n");    return path;   }      string md5hash(string input)   { -  string h = Crypto.MD5()->hash(input); +  string h = Crypto.MD5.hash(input);    return String.string2hex(h);   }      string get_local_modulepath()   {    string dir = System.get_home();       if(!dir)    {    throw(Error.Generic("Unable to determine home directory. "    "Please set HOME environment variable and retry.\n"));    }    dir = combine_path(dir, "lib/pike/modules");       return dir;   } -  +