pike.git / bin / export.pike

version» Context lines:

pike.git/bin/export.pike:1:   #! /usr/bin/env pike      multiset except_modules = (<>);   string vpath;      string main_branch;    + // NB: This script is run with an installed Pike binary, which + // is likely to be older than the one we are exporting... + #if constant(String.trim) + constant trim = String.trim; + #else + constant trim = String.trim_all_whites; + #endif +    string dirname(string dir)   {    array tmp=dir/"/";    if(tmp[-1]=="") tmp=tmp[..sizeof(tmp)-2];    tmp=tmp[..sizeof(tmp)-2];    if(sizeof(tmp)<2) return "/";    return tmp*"/";   }      array(string) get_files(string path)
pike.git/bin/export.pike:62:    args = args[..<1];    }       mapping r = Process.run( ({ cmd }) + args, mods );    if( r->exitcode && fail )    {    fail(r);    }   }    - void fix_configure(string dir) + void fix_configure(string dir, Stdio.Stat aclocal)   {    Stdio.Stat config=file_stat(dir+"/configure");    Stdio.Stat config_in=file_stat(dir+"/configure.in");       if(config_in)    { -  if(!config || config_in->mtime > config->mtime) +  if(!config || config_in->mtime > config->mtime || +  (aclocal && aclocal->mtime > config->mtime))    {    werror("Fixing configure in "+dir+".\n"); -  run( "autoconf", ([ "cwd":dir ]) ); +  run( pike_base_name+"/src/run_autoconfig", "--no-recursion", dir );    }    }   }      array(int) getversion()   {    string s = Stdio.read_file(pike_base_name+"/src/version.h");       if(!s)    {
pike.git/bin/export.pike:125:    s = pre + " PIKE_BUILD_VERSION " + rel + post;    Stdio.write_file( pike_base_name+"/src/version.h", s);    return ((array(string))getversion())*".";   }      string git_cmd(string ... args)   {    mapping r = Process.run( ({ "git" }) + args );    if( r->exitcode )    exit(r->exitcode, "Git command \"git %s\" failed.\n%s", args*" ", r->stderr||""); -  return String.trim_all_whites(r->stdout||""); +  return trim(r->stdout||"");   }      void git_bump_version()   {    werror("Bumping release number.\n");       int bump_minor = 0;       string branch = git_cmd("symbolic-ref", "HEAD");   
pike.git/bin/export.pike:199:    werror("The following files and/or directories were not found:\n\t"    + missing * "\t\n"    + "\n(you might want to add --force)\n");    return 0;    }    return ret;   }      constant stamp=#"Pike export stamp   time:%t + type:%type   major:%maj   minor:%min   build:%bld -  + revision:%rev + source:%src   year:%Y   month:%M   day:%D   hour:%h   minute:%m   second:%s   ";      string pike_base_name;   string srcdir;
pike.git/bin/export.pike:334:    git_cmd("tag", tag, "HEAD^");    if (remote) {    git_cmd("push", remote, "refs/tags/" + tag + ":refs/tags/" + tag);    }       /* Bumping is done, now go back to the stable version,    * so that we can create the dist files. */    git_cmd("checkout", tag);    }    +  string revision = git_cmd("rev-list", "-1", "HEAD"); +  string source = ((git_cmd("ls-tree", "HEAD", "src")/"\t")[0]/" ")[-1]; +     t = t||time();    mapping m = gmtime(t);    array(int) version = getversion();    mapping symbols=([    "%maj":(string) version[0],    "%min":(string) version[1],    "%bld":(string) version[2], -  +  "%rev":revision, +  "%src":source, +  "%type":snapshot?"snapshot":"release",    "%Y":sprintf("%04d",1900+m->year),    "%M":sprintf("%02d",1+m->mon),    "%D":sprintf("%02d",m->mday),    "%h":sprintf("%02d",m->hour),    "%m":sprintf("%02d",m->min),    "%s":sprintf("%02d",m->sec),    "%t":(string)t,    ]);       vpath = filename = replace(filename,symbols);       if (snapshot)    vpath = sprintf("Pike-v%d.%d-snapshot", @version);    -  fix_configure(pike_base_name+"/src"); +  Stdio.Stat aclocal=file_stat(pike_base_name+"/src/aclocal.m4");    -  +  fix_configure(pike_base_name+"/src", aclocal); +  fix_configure(pike_base_name+"/src/modules", aclocal); +  fix_configure(pike_base_name+"/src/post_modules", aclocal); +     foreach(get_dir(pike_base_name+"/src/modules"), string fn)    if(Stdio.is_dir(pike_base_name+"/src/modules/"+fn)) -  fix_configure("modules/"+fn); +  fix_configure(pike_base_name+"/src/modules/"+fn, aclocal); +  foreach(get_dir(pike_base_name+"/src/post_modules"), string fn) +  if(Stdio.is_dir(pike_base_name+"/src/post_modules/"+fn)) +  fix_configure(pike_base_name+"/src/post_modules/"+fn, aclocal);       rm(vpath);    symlink(".", vpath);       files = build_file_list(export_list);    if(!files)    clean_exit(1, "Unable to build file list.\n");       Stdio.write_file("buildid.txt", replace(stamp, symbols));    files += ({ vpath+"/buildid.txt" });
pike.git/bin/export.pike:401:    Stdio.cp(build+"/autodoc.xml", vpath+"/refdoc/autodoc.xml");    run( "cp", "-R", build+"/doc_build/images", vpath+"/refdoc/images" );    run( "tar", "rf", pike_base_name+"/"+filename+".tar",    vpath+"/refdoc/autodoc.xml", vpath+"/refdoc/images" )    {    clean_exit(1, "Tar file creation failed!\n");    };    Stdio.recursive_rm(vpath);    }    +  rm(pike_base_name+"/"+filename+".tar.gz");    run( "gzip", "-9", pike_base_name+"/"+filename+".tar" )    {    clean_exit(1, "Gzip failed!\n");    };       clean_exit(0, "Done.\n");   }      constant documentation = #"   Usage: export.pike <arguments> <except modules>