Changeset fa3cded in tol
- Timestamp:
- Jun 16, 2011, 8:17:26 AM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 9180d52
- Parents:
- 8aa53ad
- File:
-
- 1 edited
-
tol/stdlib/general/TolPackage/client.tol (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/general/TolPackage/client.tol
r8aa53ad rfa3cded 26 26 Set _.packInstalled = Copy(Empty); 27 27 28 Text common_php_arguments = "";28 Text _common_php_arguments = ""; 29 29 30 30 Real trace_max_level = 0; … … 52 52 Real _trace("Initialize", "Begin", 1); 53 53 Real TolPackage::Initialize(void); 54 Text common_php_arguments :=54 Text _common_php_arguments := 55 55 "tol_package_version="<<TolPackage::_.version+ 56 56 "&tol_version="+Replace(TolPackage::_.currentTolVersion," ","%20"); … … 253 253 { 254 254 Real key = IntRand(111111111,999999999); 255 Set info = GetRepositoryInfo(url+"?"+ common_php_arguments+255 Set info = GetRepositoryInfo(url+"?"+_common_php_arguments+ 256 256 "&action=ping&key="<<key); 257 257 Real ok = Case( … … 294 294 { 295 295 //WriteLn("_trace [GetMinTolVersionForPackage] 4 repositories["<<k+"]="<<repositories[k]); 296 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+ common_php_arguments+296 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+_common_php_arguments+ 297 297 "&action=versions&limit=1&package="+package); 298 298 //WriteLn("_trace [GetMinTolVersionForPackage] 5 pkgInfo="<<pkgInfo); … … 329 329 { 330 330 //WriteLn("_trace [GetMaxTolVersionForPackage] 4 repositories["<<k+"]="<<repositories[k]); 331 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+ common_php_arguments+331 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+_common_php_arguments+ 332 332 "&action=versions&limit=1&package="+package); 333 333 //WriteLn("_trace [GetMaxTolVersionForPackage] 5 pkgInfo="<<pkgInfo); … … 368 368 { 369 369 //WriteLn("_trace [RemoteFindRepository] 4 repositories["<<k+"]="<<repositories[k]); 370 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+ common_php_arguments+370 Set pkgLst = GetRepositoryInfo(repositories[k]+"?"+_common_php_arguments+ 371 371 "&action=versions&limit=1&package="+package); 372 372 //WriteLn("_trace [RemoteFindRepository] 6 pkgLst="<<pkgLst); … … 398 398 If(rep=="", UnknownDate, 399 399 { 400 Set pkgLst = GetRepositoryInfo(rep+"?"+ common_php_arguments+400 Set pkgLst = GetRepositoryInfo(rep+"?"+_common_php_arguments+ 401 401 "&action=versions&limit=1&package="+package); 402 402 If(!Card(pkgLst), TheEnd, … … 430 430 pkg.tok.num==2, pkg.tok[1]+"."+pkg.tok[2], 431 431 pkg.tok.num==1, pkg.tok[1]); 432 Set pkgLst = GetRepositoryInfo(repository+"?"+ common_php_arguments+432 Set pkgLst = GetRepositoryInfo(repository+"?"+_common_php_arguments+ 433 433 "&action=versions&limit=1&package="+package.version); 434 434 Real ok := Card(pkgLst); … … 448 448 Text localDir = localRoot+"/"+package.version; 449 449 450 Text encoded = GetUrlContents(repository+"?"+ common_php_arguments+450 Text encoded = GetUrlContents(repository+"?"+_common_php_arguments+ 451 451 "&action=download"+ 452 452 "&format=base64"+ … … 504 504 Real ok = If(!ChecktolProjectPing(?), 0, 505 505 { 506 Set pkgLst = GetRepositoryInfo(repository+"?"+ common_php_arguments+506 Set pkgLst = GetRepositoryInfo(repository+"?"+_common_php_arguments+ 507 507 "&action=versions"); 508 508 If(!Card(pkgLst), False, … … 615 615 Set _.versSyncInfo := SetConcat(EvalSet(repositories,Set(Text rep) 616 616 { 617 GetRepositoryInfo(rep+"?"+ common_php_arguments+"&action=versions")617 GetRepositoryInfo(rep+"?"+_common_php_arguments+"&action=versions") 618 618 })); 619 619 Real SetIndexByName(_.versSyncInfo); … … 662 662 Set _.packSyncInfo := SetConcat(EvalSet(repositories,Set ev.rep(Text rep) 663 663 { 664 GetRepositoryInfo(rep+"?"+ common_php_arguments+"&action=packages")664 GetRepositoryInfo(rep+"?"+_common_php_arguments+"&action=packages") 665 665 })); 666 666 Real SetIndexByName(_.packSyncInfo); … … 807 807 Real If(!Card(_.versSyncInfo), 808 808 TolPackage::Client::RemoteUpdateVersSyncInfo(True)); 809 809 810 810 Set sel_compatible = Select(_.versSyncInfo, 811 811 Real(TolPackage::@VersionSynchro reg) 812 812 { 813 And( reg->co_name==package,813 And(TextBeginWith(reg->co_name_version,package), 814 814 tol_version>=reg->te_min_tol_version, 815 815 tol_version<=reg->te_max_tol_version) 816 816 }); 817 818 Set last_compatible = Sort(sel_compatible, 819 Real(TolPackage::@VersionSynchro a, TolPackage::@VersionSynchro b) 820 { 821 Compare.VersionString(b->co_name_version,a->co_name_version) 822 })[1]; 823 Real _trace("GetCompatibleVersion.one", "End", 1); 824 last_compatible->co_name_version 817 If(!Card(sel_compatible), 818 { 819 WriteLn("[GetCompatibleVersion.one] Cannot find a version of package "<< 820 package+" compatible with TOL "+tol_version,"E"); 821 Real Stop; 822 "" 823 }, 824 { 825 Set last_compatible = Sort(sel_compatible, 826 Real(TolPackage::@VersionSynchro a, TolPackage::@VersionSynchro b) 827 { 828 Compare.VersionString(b->co_name_version,a->co_name_version) 829 })[1]; 830 Real _trace("GetCompatibleVersion.one", "End", 1); 831 last_compatible->co_name_version 832 }) 825 833 }; 826 834 … … 844 852 //////////////////////////////////////////////////////////////////////////////// 845 853 { 846 Real _trace("GetDeepDependencies.one ", "Begin", 1);854 Real _trace("GetDeepDependencies.one("+package.version+")", "Begin", 1); 847 855 Real If(!Card(_.versSyncInfo), 848 856 TolPackage::Client::RemoteUpdateVersSyncInfo(True)); … … 870 878 //////////////////////////////////////////////////////////////////////////////// 871 879 { 872 Unique(SetConcat(EvalSet(package.version.list, GetDeepDependencies.one))) 880 Real _trace("GetDeepDependencies.all", "Begin", 1); 881 Set tab = EvalSet(package.version.list, GetDeepDependencies.one); 882 Set uni = Unique(SetConcat(tab)); 883 Real _trace("GetDeepDependencies.all", "End", 1); 884 uni 873 885 }; 874 886 … … 897 909 //////////////////////////////////////////////////////////////////////////////// 898 910 { 911 Real _trace("GetCompatibleDeepDependencies", "Begin", 1); 899 912 Set package.version.list = GetCompatibleVersion.all(tol_version, package.list); 900 GetVersionInfo(GetDeepDependencies.all(package.version.list)) 913 Set dep = GetVersionInfo(GetDeepDependencies.all(package.version.list)); 914 Real _trace("GetCompatibleDeepDependencies", "End", 2); 915 dep 901 916 }; 902 917 … … 919 934 { 920 935 Real _trace("DownloadCompatibleDeepDependencies", "Begin", 1); 921 Real If(cleanLocalRoot, OSDirRemove(localRoot)); 922 Set dep = GetCompatibleDeepDependencies(tol_version, package.list); 923 Real ok = SetMin(EvalSet(dep, Real(TolPackage::@VersionSynchro vsi) 924 { 925 DownloadPackage(vsi->te_url,vsi->co_name_version,True,localRoot) 926 })); 927 Real _trace("DownloadCompatibleDeepDependencies", "End", 1); 928 ok 936 If(tol_version>TolPackage::_.currentTolVersion, 937 { 938 WriteLn("[DownloadCompatibleDeepDependencies] Cannot download packages for " 939 "TOL "+tol_version+" using TOL "+TolPackage::_.currentTolVersion,"E"); 940 False 941 }, 942 { 943 Real If(cleanLocalRoot, OSDirRemove(localRoot)); 944 Set dep = GetCompatibleDeepDependencies(tol_version, package.list); 945 Real ok = SetMin(EvalSet(dep, Real(TolPackage::@VersionSynchro vsi) 946 { 947 DownloadPackage(vsi->te_url,vsi->co_name_version,True,localRoot) 948 })); 949 Real _trace("DownloadCompatibleDeepDependencies", "End", 1); 950 ok 951 }) 929 952 }; 930 953
Note: See TracChangeset
for help on using the changeset viewer.
