Changeset 8e89cc8 in tol
- Timestamp:
- Jun 15, 2010, 12:41:31 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 09356b1
- Parents:
- 06709e3
- File:
-
- 1 edited
-
tol/stdlib/general/TolPackage/repository.tol (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/general/TolPackage/repository.tol
r06709e3 r8e89cc8 2 2 ////////////////////////////////////////////////////////////////////////////// 3 3 // FILE : repository.tol 4 // PURPOSE: Class TolPackage:: Repository4 // PURPOSE: Class TolPackage::@Repository 5 5 ////////////////////////////////////////////////////////////////////////////// 6 6 7 7 ////////////////////////////////////////////////////////////////////////////// 8 8 //Información de un paquete dentro del archivo de estado un repositorio 9 Struct PackageInfo {9 Struct @PackageInfo { 10 10 ////////////////////////////////////////////////////////////////////////////// 11 11 Text repository, … … 21 21 22 22 ////////////////////////////////////////////////////////////////////////////// 23 Class Repository {23 Class @Repository { 24 24 ////////////////////////////////////////////////////////////////////////////// 25 25 … … 52 52 //Si hay cambios en el directorio remoto durante la sesión TOL estos no serán 53 53 //percibidos. 54 Static Repository Get(Text url)55 ////////////////////////////////////////////////////////////////////////////// 56 { 57 Real pos = FindIndexByName( Repository::_.instances, ToName(url));54 Static @Repository Get(Text url) 55 ////////////////////////////////////////////////////////////////////////////// 56 { 57 Real pos = FindIndexByName(@Repository::_.instances, ToName(url)); 58 58 If(pos, _.instances[pos], 59 59 { 60 Repository::_Open(url)60 @Repository::_Open(url) 61 61 }) 62 62 }; … … 64 64 ////////////////////////////////////////////////////////////////////////////// 65 65 //Abre un repositorio por primera vez 66 Static Repository _Open(Text url)66 Static @Repository _Open(Text url) 67 67 ////////////////////////////////////////////////////////////////////////////// 68 68 { … … 72 72 //Resto de la URL tras el protocolo 73 73 Text address = SubString(url,prtPos+1,TextLength(url)); 74 Set aux = [[ Repository new = [[74 Set aux = [[ @Repository new = [[ 75 75 Text _.url = url; 76 76 Text _.protocol = protocol; … … 80 80 { 81 81 NameBlock PutName(ToName(url), aux[1]); 82 Real Append( Repository::_.instances, aux, True);82 Real Append(@Repository::_.instances, aux, True); 83 83 True 84 84 }); … … 125 125 Text aux = GetFileContens("packages.csv"); 126 126 Set line = Tokenizer(aux,"\n"); 127 Set pckInf = For(2,Card(line), PackageInfo(Real k)127 Set pckInf = For(2,Card(line), @PackageInfo(Real k) 128 128 { 129 129 Set fields = Tokenizer(line[k],";","\"","\\"); 130 Set aux = [[{ PackageInfo(130 Set aux = [[{@PackageInfo( 131 131 Text repository = url, 132 132 Text name = fields[1], … … 143 143 aux[1] 144 144 }); 145 Set _.status := Sort(pckInf,Real( PackageInfo a,PackageInfo b)145 Set _.status := Sort(pckInf,Real(@PackageInfo a, @PackageInfo b) 146 146 { 147 147 Compare(b->name.version, a->name.version) … … 188 188 ////////////////////////////////////////////////////////////////////////////// 189 189 { 190 SetMin(EvalSet(_.status, Real( PackageInfo pi)190 SetMin(EvalSet(_.status, Real(@PackageInfo pi) 191 191 { 192 192 DownloadFile(pi->name.version) … … 229 229 ////////////////////////////////////////////////////////////////////////////// 230 230 { 231 SetSum(EvalSet(_.status, Real( PackageInfo pi)231 SetSum(EvalSet(_.status, Real(@PackageInfo pi) 232 232 { 233 233 Upgrade(pi->name.version)
Note: See TracChangeset
for help on using the changeset viewer.
