Changeset 01f6b1c7 in tol for tol_pkg/_uploader.tol


Ignore:
Timestamp:
Nov 11, 2009, 10:37:38 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
3a8f94f
Parents:
314a6ad
Message:

Related to #648

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_pkg/_uploader.tol

    r314a6ad r01f6b1c7  
    1010Text local = ".";
    1111Text export = tolpkg+"export";
    12 Text upload = tolpkg+"upload";
     12Text upload = tolpkg+"tol_pkg";
    1313Real OSDirRemove(tolpkg);
    1414
    … …  
    4545Real wiki = FOpen(tolpkg+"wiki.txt","wb");
    4646
    47 Real FPutText(wiki,"[[PageOutline]]\n"
    48 "= TOL Packages =\n"
    49 "TOL packages are libraries, tools and examples writen in TOL in order to "
    50 "help users to make an efficient and standarized use of the language.\n\n");
     47Real FPutText(wiki,"
     48[[PageOutline]]
     49= TOL Packages =
     50TOL packages are objects of type NameBlock containinig libraries, tools and
     51examples writen in TOL in order to help users to make an efficient and
     52standarized use of the language.
     53
     54The only requirement to use them is open source cross-platform sofware
     55[http://www.gnu.org/software/wget/ wget] that is distributed with almost
     56all linux systems. A Windows binary setup is available
     57[http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe here].
     58
     59In order to load a package like !GraphTools in your code you only need to
     60write
     61{{{
     62#Require GraphTools;
     63}}}
     64
     65This command creates an object of type NameBlock with the same name in the
     66global scope, so that subsequent calls from the same session does
     67absolutely nothing. The command returns nothing in the current scope, ie is
     68transparent to the browser !TolBase and for the contents of the sets,
     69instances, etc. The first time you use a package in a computer it will be
     70automatically installed from this public repository.
     71
     72If you want to upgrade to a newer version of a package you can call global
     73function
     74{{{
     75Real UpgradePackage(Text PackageName)
     76}}}
     77In order to upgrade all local packages you can write
     78{{{
     79Real UpgradePackage(\"all\")
     80}}}
     81
     82The package is a root directory whose name follows the CamelCase convention,
     83and it will have a file almost a file with teh same name and extension
     84{{{.tol}}} containg just one object of type NameBlock that is the TOL engine
     85of the package. From the NameBlock it will be loaded any file situated
     86inside the root directory in an arbitrary hierarchy of subdirectories.
     87
     88Usually the directory have also an special directory called '''test''' where
     89there standard TOL checking programs tha can be used also as examples of use.
     90
     91Some complex packages can require specific documentation that will be put in
     92'''doc''' directory
     93
     94");
     95
     96Text WriteFile(tolpkg+"compress.bat",
     97"cd \""+ReplaceSlash(export)+"\"\n"+
     98"zip -9 -r %1.zip %1\n"
     99"mv %1.zip ..\\tol_pkg\n"
     100);
    51101
    52102Set EvalSet(packages, Real(Text name)
    53103{
    54   Text loc = local+"/"+name;
    55104  Text exp = export+"/"+name;
    56105  Text upl = upload+"/"+name;
    57   Set aux = {[[Include(loc+"/_"+name+".tol")]]};
     106  Set aux = {[[Include(exp+"/"+name+".tol")]]};
    58107  NameBlock nb = aux[1][1];
    59108  Real FPutText(wiki,
    … …  
    66115  " ["+name+" Official page]"
    67116  " [source:/tolp/trunk/tol_pkg/"+name+" view source code]"
    68   " [http://packages.tol-project.org/tol_pkg/upload/"+name+".zip download full package]"
    69   " [http://packages.tol-project.org/tol_pkg/upload/"+name+".oza download just OIS compressed package]
     117  " [http://packages.tol-project.org/tol_pkg/"+name+".zip download full package]"
     118  " [http://packages.tol-project.org/tol_pkg/"+name+".oza download just OIS compressed package]
    70119");
    71120  Real Ois.Store(aux[1],upl+".oza");
    72   Real OSCmdWaitWr("zip -9 -r "+
    73                ReplaceSlash("\""+upl+".zip\"")+" "+
    74                ReplaceSlash("\""+exp+"\""))
     121  Real OSCmdWaitWr("\""+tolpkg+"compress.bat\" "+name)
    75122});
    76123
    … …  
    80127  "toldevel@tolp.localbayes.es";
    81128Text remoteRoot =
    82   "/var/www/packages/tol_pkg";
     129  "/var/www/packages";
    83130
    84131Text WriteFile(upload+".bat",
    85132"cd \""+ReplaceSlash(tolpkg)+"\"\n"+
    86 "tar cvzf upload.tgz upload\n"+
    87 "pscp upload.tgz "+remoteUser+":"+remoteRoot+"/upload.tgz\n"
    88 "plink "+remoteUser+" \"cd "+remoteRoot+";./upload_local.sh\"\n"
     133"tar cvzf tol_pkg.tgz tol_pkg\n"+
     134"pscp tol_pkg.tgz "+remoteUser+":"+remoteRoot+"/tol_pkg.tgz\n"
     135"plink "+remoteUser+" \"cd "+remoteRoot+";./upload_tol_pkg.sh\"\n"
    89136);
    90137Real OSCmdWaitWr("\""+ReplaceSlash(upload+".bat")+"\"");
Note: See TracChangeset for help on using the changeset viewer.