| 1 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // FILE : uploader.tol |
|---|
| 3 | // PURPOSE : call all prepared tests about TOL features checking are binding |
|---|
| 4 | // to decide if a version should be published or not. |
|---|
| 5 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 6 | |
|---|
| 7 | Set Include("_install_tools.tol"); |
|---|
| 8 | |
|---|
| 9 | //Text compress = "\"c:\Archivos de programa\7-Zip\7z.exe\" a -r -tzip "; |
|---|
| 10 | Text compress = " "; |
|---|
| 11 | Text tolpkg = TmpDir+"tol_pkg/"; |
|---|
| 12 | Text local = "."; |
|---|
| 13 | Text export = tolpkg+"export"; |
|---|
| 14 | Text upload = tolpkg+"tol_pkg/"+version; |
|---|
| 15 | |
|---|
| 16 | Real OSDirRemove(tolpkg); |
|---|
| 17 | Real OSDirMake(tolpkg); |
|---|
| 18 | Real OSDirMake(upload); |
|---|
| 19 | |
|---|
| 20 | Real OSCmdWaitWr("svn export --force " |
|---|
| 21 | "https://www.tol-project.org/svn/tolp/trunk/tol_pkg \""+export+"\""); |
|---|
| 22 | |
|---|
| 23 | Text SetOfTextToWikiList(Set set, Text margin, Text quote) |
|---|
| 24 | { |
|---|
| 25 | If(Card(set)==1,quote+set[1]+quote, |
|---|
| 26 | SetSum(For(1,Card(set),Text(Real k) |
|---|
| 27 | { |
|---|
| 28 | margin+quote+set[k]+quote |
|---|
| 29 | }))) |
|---|
| 30 | }; |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | Real wiki = FOpen(tolpkg+"wiki.txt","wb"); |
|---|
| 34 | |
|---|
| 35 | Real FPutText(wiki,ReadFile("_wiki_header.txt")); |
|---|
| 36 | |
|---|
| 37 | Text WriteFile(tolpkg+"compress.bat", |
|---|
| 38 | "cd \""+ReplaceSlash(export)+"\"\n"+ |
|---|
| 39 | "zip -9 -r %1.zip %1\n" |
|---|
| 40 | "mv %1.zip ..\\tol_pkg\\"+version+"\n" |
|---|
| 41 | ); |
|---|
| 42 | |
|---|
| 43 | Set EvalSet(packages, Real(Text name) |
|---|
| 44 | { |
|---|
| 45 | Text exp = export+"/"+name; |
|---|
| 46 | Text upl = upload+"/"+name; |
|---|
| 47 | Set aux = {[[Include(exp+"/"+name+".tol")]]}; |
|---|
| 48 | NameBlock nb = aux[1][1]; |
|---|
| 49 | Real FPutText(wiki, |
|---|
| 50 | " |
|---|
| 51 | === !"+name+" === |
|---|
| 52 | "+nb::_.autodoc.description+" |
|---|
| 53 | * '''keywords''' : "+SetOfTextToWikiList(nb::_.autodoc.keys," ","__")+" |
|---|
| 54 | * '''authors''' : "+SetOfTextToWikiList(nb::_.autodoc.authors," ","''")+" |
|---|
| 55 | * '''links''' : " |
|---|
| 56 | " ["+name+" Official page]" |
|---|
| 57 | " [source:/tolp/trunk/tol_pkg/"+name+" view source code]" |
|---|
| 58 | " [http://packages.tol-project.org/tol_pkg/"+name+".zip download full package]" |
|---|
| 59 | " [http://packages.tol-project.org/tol_pkg/"+name+".oza download just OIS compressed package] |
|---|
| 60 | "); |
|---|
| 61 | Real Ois.Store(aux[1],upl+".oza"); |
|---|
| 62 | Real OSCmdWaitWr("cp \""+upl+".oza\" \""+ReplaceSlash(tolpkg_install)+"\""); |
|---|
| 63 | Real OSCmdWaitWr("\""+tolpkg+"compress.bat\" "+name) |
|---|
| 64 | }); |
|---|
| 65 | |
|---|
| 66 | Real FClose(wiki); |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | Text remoteUser = |
|---|
| 70 | "toldevel@tolp.localbayes.es"; |
|---|
| 71 | Text remoteRoot = |
|---|
| 72 | "/var/www/packages"; |
|---|
| 73 | |
|---|
| 74 | Text WriteFile(upload+".bat", |
|---|
| 75 | "cd \""+ReplaceSlash(tolpkg+"/tol_pkg")+"\"\n"+ |
|---|
| 76 | "tar cvzf "+version+".tgz "+version+"\n"+ |
|---|
| 77 | "pscp "+version+".tgz "+remoteUser+":"+remoteRoot+"/tol_pkg/"+version+".tgz\n" |
|---|
| 78 | "plink "+remoteUser+" \"cd "+remoteRoot+"/tol_pkg; ./upload_tol_pkg.sh "+version+"\"\n" |
|---|
| 79 | ); |
|---|
| 80 | Real OSCmdWaitWr("\""+ReplaceSlash(upload+".bat")+"\""); |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | /* */ |
|---|