5c8e891995-10-29Fredrik Hübinette (Hubbe) #!/usr/local/bin/ulpc
1611071995-11-03Fredrik Hübinette (Hubbe) string *get_files(string path) { string *files,tmp,*ret; files=get_dir(path); files-=({"CVS","RCS",".cvsignore"}); ret=({}); foreach(files,tmp) { if(tmp[-1]=='~') continue; if(tmp[0]=='#' && tmp[-1]=='#') continue; if(tmp[0]=='.' && tmp[1]=='#') continue; tmp=path+"/"+tmp; if(file_size(tmp)==-2) { ret+=get_files(tmp); }else{ ret+=({tmp}); } } return ret; }
5c8e891995-10-29Fredrik Hübinette (Hubbe) int main(int argc, string *argv) { mixed tmp; int e;
1611071995-11-03Fredrik Hübinette (Hubbe)  string files;
5c8e891995-10-29Fredrik Hübinette (Hubbe)  string s=replace(version()," ","_"); tmp=explode(argv[0],"/"); tmp=reverse(tmp); e=search(tmp,"ulpc"); if(e==-1) { perror("Couldn't find uLPC source dir.\n"); perror("Use export.lpc <sourcedir>.\n"); exit(1); } tmp=tmp[e+1..sizeof(tmp)-1]; tmp=reverse(tmp); cd(tmp*"/"); perror("Sourcedir = "+tmp*"/"+"/ulpc\n");
1611071995-11-03Fredrik Hübinette (Hubbe)  files=sum(({ "ulpc/README" }), get_files("ulpc/src"), get_files("ulpc/doc"), get_files("ulpc/lib"), get_files("ulpc/bin"));
5c8e891995-10-29Fredrik Hübinette (Hubbe)  perror("Creating "+s+".tar.gz:\n");
1611071995-11-03Fredrik Hübinette (Hubbe)  system("tar cvzf ulpc/"+s+".tar.gz "+files*" ");
5c8e891995-10-29Fredrik Hübinette (Hubbe)  perror("Done.\n"); return 0; }