Changeset 6a75065 in tol


Ignore:
Timestamp:
Jul 9, 2010, 10:06:05 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0813b41
Parents:
670a2e9
Message:

Cada paquete puede tener su propio directorio de fuentes independiente

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/general/TolPackage/builder.tol

    r670a2e9 r6a75065  
    1010//////////////////////////////////////////////////////////////////////////////
    1111
    12 Text _.url;          //A unique address with remote or local protocol
    13 Text _.name;         //A unique name
    14 Text _.type;         //Private, Public
    15 Text _.description;  //Purpose of repository
    16 Text _.sourceRoot;   //Root directory of package's TOL code
    17 Set  _.packageList;  //Set of names of packages
    18 Text _.root;         //Local server-side installing directory
    19 Text _.register;     //Local server-side register directory
    20 Text _.index;        //Local server-side index prefix
     12Text _.url;           //A unique address with remote or local protocol
     13Text _.name;          //A unique name
     14Text _.type;          //Private, Public
     15Text _.description;   //Purpose of repository
     16Set  _.packageList;   //Set of names of packages
     17Set  _.pkgSourcePath; //Set of paths of packages
     18Text _.root;          //Local server-side installing directory
     19Text _.register;      //Local server-side register directory
     20Text _.index;         //Local server-side index prefix
    2121
    2222
    … …  
    2828  Text description, 
    2929  Text sourceRoot,
    30   Set packageList)
     30  Set packageList_)
    3131//////////////////////////////////////////////////////////////////////////////
    3232{
    3333  Text root = TolPackage::Server::_.localRoot+name+"/";
     34  Set pkgSourcePath = If(sourceRoot=="",
     35  {
     36    EvalSet(packageList_,GetFilePath)
     37  },
     38  {
     39    NCopy(Card(packageList_),sourceRoot)
     40  });
     41  Set packageList = If(sourceRoot=="",
     42  {
     43    EvalSet(packageList_,GetFilePrefix)
     44  },
     45  {
     46    DeepCopy(packageList_)
     47  });
    3448  @Builder new = [[
    3549    Text _.url = url;
    … …  
    3751    Text _.type = type;
    3852    Text _.description = description;
    39     Text _.sourceRoot = sourceRoot;
    4053    Set  _.packageList = packageList;
     54    Set  _.pkgSourcePath = pkgSourcePath;
    4155    Text _.root = root;
    4256    Text _.register = root+"register/";
    … …  
    4559  Real OSDirMake(new::_.root);
    4660  Real OSDirMake(new::_.register);
     61
    4762  Real new::Build.All(0);
    4863  new
    … …  
    131146
    132147//////////////////////////////////////////////////////////////////////////////
    133 Text Build.PackageInfo.Version(Text name, Real specificVersion)
     148Text Build.PackageInfo.Version(Text sourcePath, Text name, Real specificVersion)
    134149//////////////////////////////////////////////////////////////////////////////
    135150{
    136151  Set aux = IncludeText("NameBlock "+name+";");
    137152  NameBlock pkg = aux[1];
     153  Text sourceRoot = sourcePath+"/"+name;
    138154  Text pkgName = TolPackage::GetCurrentNameVersion(name,specificVersion);
    139155  Set dependencies = TolPackage::GetDeepDependencies(name, specificVersion);
    … …  
    168184    Set EvalSet(selResources, Real(Text resource)
    169185    {
    170       Text orig = _.sourceRoot+name+"/"+resource;
     186      Text orig = sourceRoot+"/"+resource;
    171187      Text dest = ppRoot+"/"+resource;
    172188      Real OSDirMake(dest);
    … …  
    187203
    188204//////////////////////////////////////////////////////////////////////////////
    189 Text Build.PackageInfo(Text name)
    190 //////////////////////////////////////////////////////////////////////////////
    191 {
    192   Build.PackageInfo.Version(name,True)+
    193   Build.PackageInfo.Version(name,False)
     205Text Build.PackageInfo(Text sourcePath, Text name)
     206//////////////////////////////////////////////////////////////////////////////
     207{
     208  Build.PackageInfo.Version(sourcePath, name,True)+
     209  Build.PackageInfo.Version(sourcePath, name,False)
    194210};
    195211
    … …  
    200216{
    201217  Real Initialize(void);
    202   Set EvalSet(_.packageList, Real(Text pkgName)
    203   {
    204     Text AppendFile(_.index+".csv",  Build.PackageInfo(pkgName));
     218  Set For(1,Card(_.packageList), Real(Real k)
     219  {
     220    Text pkgName = _.packageList[k];
     221    Text sourcePath = _.pkgSourcePath[k];
     222    Text AppendFile(_.index+".csv",  Build.PackageInfo(sourcePath, pkgName));
    205223  //Text AppendFile(_.index+".wiki", index.wiki);
    206224  //Text AppendFile(_.index+".html", index.html);
    … …  
    212230
    213231//////////////////////////////////////////////////////////////////////////////
    214 Real Rebuild.One(Text pkgName)
     232Real Rebuild.One(Text sourcePath, Text pkgName)
    215233//////////////////////////////////////////////////////////////////////////////
    216234{
    217235  Real Initialize(void);
    218   Text Build.PackageInfo(pkgName);
     236  Text Build.PackageInfo(sourcePath,pkgName);
    219237  Set pkgLst = Sort(GetDir(_.register)[2], Real(Text a, Text b)
    220238  {
Note: See TracChangeset for help on using the changeset viewer.