Changeset fa3cded in tol


Ignore:
Timestamp:
Jun 16, 2011, 8:17:26 AM (15 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
9180d52
Parents:
8aa53ad
Message:

Fixes #1257
Fixes #1258

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

File:
1 edited

Legend:

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

    r8aa53ad rfa3cded  
    2626Set _.packInstalled = Copy(Empty);
    2727
    28 Text common_php_arguments = "";
     28Text _common_php_arguments = "";
    2929
    3030Real  trace_max_level = 0;
    … …  
    5252  Real _trace("Initialize", "Begin", 1);
    5353  Real TolPackage::Initialize(void);
    54   Text common_php_arguments :=
     54  Text _common_php_arguments :=
    5555    "tol_package_version="<<TolPackage::_.version+
    5656    "&tol_version="+Replace(TolPackage::_.currentTolVersion," ","%20");
    … …  
    253253  {
    254254    Real key = IntRand(111111111,999999999);
    255     Set info = GetRepositoryInfo(url+"?"+common_php_arguments+
     255    Set info = GetRepositoryInfo(url+"?"+_common_php_arguments+
    256256      "&action=ping&key="<<key);
    257257    Real ok = Case(
    … …  
    294294    {
    295295    //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+
    297297        "&action=versions&limit=1&package="+package);
    298298    //WriteLn("_trace [GetMinTolVersionForPackage] 5 pkgInfo="<<pkgInfo);
    … …  
    329329    {
    330330    //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+
    332332        "&action=versions&limit=1&package="+package);
    333333    //WriteLn("_trace [GetMaxTolVersionForPackage] 5 pkgInfo="<<pkgInfo);
    … …  
    368368    {
    369369    //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+
    371371        "&action=versions&limit=1&package="+package);
    372372    //WriteLn("_trace [RemoteFindRepository] 6 pkgLst="<<pkgLst);
    … …  
    398398    If(rep=="", UnknownDate,
    399399    {
    400       Set pkgLst = GetRepositoryInfo(rep+"?"+common_php_arguments+
     400      Set pkgLst = GetRepositoryInfo(rep+"?"+_common_php_arguments+
    401401        "&action=versions&limit=1&package="+package);
    402402      If(!Card(pkgLst), TheEnd,
    … …  
    430430      pkg.tok.num==2, pkg.tok[1]+"."+pkg.tok[2],
    431431      pkg.tok.num==1, pkg.tok[1]);
    432     Set pkgLst = GetRepositoryInfo(repository+"?"+common_php_arguments+
     432    Set pkgLst = GetRepositoryInfo(repository+"?"+_common_php_arguments+
    433433      "&action=versions&limit=1&package="+package.version);
    434434    Real ok := Card(pkgLst);
    … …  
    448448    Text localDir = localRoot+"/"+package.version;
    449449
    450     Text encoded = GetUrlContents(repository+"?"+common_php_arguments+
     450    Text encoded = GetUrlContents(repository+"?"+_common_php_arguments+
    451451      "&action=download"+
    452452      "&format=base64"+
    … …  
    504504  Real ok = If(!ChecktolProjectPing(?), 0,
    505505  {
    506     Set pkgLst = GetRepositoryInfo(repository+"?"+common_php_arguments+
     506    Set pkgLst = GetRepositoryInfo(repository+"?"+_common_php_arguments+
    507507      "&action=versions");
    508508    If(!Card(pkgLst), False,
    … …  
    615615    Set _.versSyncInfo := SetConcat(EvalSet(repositories,Set(Text rep)
    616616    {
    617       GetRepositoryInfo(rep+"?"+common_php_arguments+"&action=versions")
     617      GetRepositoryInfo(rep+"?"+_common_php_arguments+"&action=versions")
    618618    }));
    619619    Real SetIndexByName(_.versSyncInfo);
    … …  
    662662    Set _.packSyncInfo := SetConcat(EvalSet(repositories,Set ev.rep(Text rep)
    663663    {
    664       GetRepositoryInfo(rep+"?"+common_php_arguments+"&action=packages")
     664      GetRepositoryInfo(rep+"?"+_common_php_arguments+"&action=packages")
    665665    }));
    666666    Real SetIndexByName(_.packSyncInfo);
    … …  
    807807  Real If(!Card(_.versSyncInfo),
    808808   TolPackage::Client::RemoteUpdateVersSyncInfo(True));
    809 
     809 
    810810  Set sel_compatible = Select(_.versSyncInfo,
    811811  Real(TolPackage::@VersionSynchro reg)
    812812  {
    813     And(reg->co_name==package,
     813    And(TextBeginWith(reg->co_name_version,package),
    814814        tol_version>=reg->te_min_tol_version,
    815815        tol_version<=reg->te_max_tol_version)
    816816  });
    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  })
    825833};
    826834
    … …  
    844852////////////////////////////////////////////////////////////////////////////////
    845853{
    846   Real _trace("GetDeepDependencies.one", "Begin", 1);
     854  Real _trace("GetDeepDependencies.one("+package.version+")", "Begin", 1);
    847855  Real If(!Card(_.versSyncInfo),
    848856   TolPackage::Client::RemoteUpdateVersSyncInfo(True));
    … …  
    870878////////////////////////////////////////////////////////////////////////////////
    871879{
    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
    873885};
    874886
    … …  
    897909////////////////////////////////////////////////////////////////////////////////
    898910{
     911  Real _trace("GetCompatibleDeepDependencies", "Begin", 1);
    899912  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
    901916};
    902917
    … …  
    919934{
    920935  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  })
    929952};
    930953
Note: See TracChangeset for help on using the changeset viewer.