source: tol/tol_pkg/_uploader.tol @ 6cea4d2

1941-docker-image-to-testdevel
Last change on this file since 6cea4d2 was 6cea4d2, checked in by Víctor de Buen <vdebuen@…>, 17 years ago

Ensuring main file exists

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1738 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 2.7 KB
Line 
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//Text compress = "\"c:\Archivos de programa\7-Zip\7z.exe\" a -r -tzip ";
8Text compress = " ";
9Text tolpkg = TmpDir+"tol_pkg/";
10Text local = ".";
11Text export = tolpkg+"export";
12Text version = Replace(Tokenizer(Version," ")[1],".","_");
13Text upload = tolpkg+"tol_pkg/"+version;
14Real OSDirRemove(tolpkg);
15
16Real OSCmdWaitWr(Text order)
17{
18  WriteLn(order);
19  Real OSCmdWait(order)
20};
21
22Real OSCmdWaitWr("svn export --force "
23  "https://www.tol-project.org/svn/tolp/trunk/tol_pkg \""+export+"\"");
24
25Set packages =
26{
27  Set aux = Select(GetDir(export)[2], Real(Text subDir)
28  {
29    Real fst = ASCII(Sub(subDir,1,1));
30    If(!LE(ASCII("A"),fst,ASCII("Z")),False,
31    {
32      FileExist(subDir+"/"+subDir+".tol")
33    })
34  });
35  Sort(aux,Real(Text a, Text b) { Compare(a,b) })
36};
37 
38Text SetOfTextToWikiList(Set set, Text margin, Text quote)
39{
40  If(Card(set)==1,quote+set[1]+quote,
41  SetSum(For(1,Card(set),Text(Real k)
42  {
43    margin+quote+set[k]+quote
44  })))
45};
46
47Real OSDirMake(upload);
48
49Real wiki = FOpen(tolpkg+"wiki.txt","wb");
50
51Real FPutText(wiki,ReadFile("_wiki_header.txt"));
52
53Text WriteFile(tolpkg+"compress.bat",
54"cd \""+ReplaceSlash(export)+"\"\n"+
55"zip -9 -r %1.zip %1\n"
56"mv %1.zip ..\\tol_pkg\\"+version+"\n"
57);
58
59Set EvalSet(packages, Real(Text name)
60{
61  Text exp = export+"/"+name;
62  Text upl = upload+"/"+name;
63  Set aux = {[[Include(exp+"/"+name+".tol")]]};
64  NameBlock nb = aux[1][1];
65  Real FPutText(wiki,
66"
67=== !"+name+" ===
68"+nb::_.autodoc.description+"
69 * '''keywords''' : "+SetOfTextToWikiList(nb::_.autodoc.keys," ","__")+"
70 * '''authors''' : "+SetOfTextToWikiList(nb::_.autodoc.authors," ","''")+"
71 * '''links''' : "
72  " ["+name+" Official page]"
73  " [source:/tolp/trunk/tol_pkg/"+name+" view source code]"
74  " [http://packages.tol-project.org/tol_pkg/"+name+".zip download full package]"
75  " [http://packages.tol-project.org/tol_pkg/"+name+".oza download just OIS compressed package]
76");
77  Real Ois.Store(aux[1],upl+".oza");
78  Real OSCmdWaitWr("\""+tolpkg+"compress.bat\" "+name)
79});
80
81Real FClose(wiki);
82
83Text remoteUser =
84  "toldevel@tolp.localbayes.es";
85Text remoteRoot =
86  "/var/www/packages";
87
88Text WriteFile(upload+".bat",
89"cd \""+ReplaceSlash(tolpkg+"/tol_pkg")+"\"\n"+
90"tar cvzf "+version+".tgz "+version+"\n"+
91"pscp "+version+".tgz "+remoteUser+":"+remoteRoot+"/tol_pkg/"+version+".tgz\n"
92"plink "+remoteUser+" \"cd "+remoteRoot+"/tol_pkg; ./upload_tol_pkg.sh "+version+"\"\n"
93);
94Real OSCmdWaitWr("\""+ReplaceSlash(upload+".bat")+"\"");
95
96
97
98/* */
Note: See TracBrowser for help on using the repository browser.