Changeset ed32db7 in tol


Ignore:
Timestamp:
Apr 16, 2015, 7:40:08 AM (12 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
98bcbd6
Parents:
f5c3010
Message:

Refs #1821
Se modifica la llamada a LocalLastCompatible para evitar un error tras instalar y cargar un paquete automáticamente con #Require.
Se opta por este tipo de soluciones para permitir que TolPackage.4 sea compatible con versiones anteriores de TOL.

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

File:
1 edited

Legend:

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

    rf5c3010 red32db7  
    108108        Text Sub(package, 1, length-1), package); // Se elimina el punto final
    109109      @Catalog catalog = GetCatalog(?);
    110       AvoidErr.NonDecAct(catalog::ObtainLastCompatible(packageWP))
     110      Text ans = AvoidErr.NonDecAct(catalog::ObtainLastCompatible(packageWP));
     111      // Es necesario devolver el identificador del paquete sin variante
     112      // cuando se llama justo después de instalar un paquete.
     113      If(_RemoteInstall.JustCalled, {
     114        Real _RemoteInstall.JustCalled := False;
     115        Real posN = TextFind(ans, "#");
     116        If(posN>0, {
     117          Real posP = TextFind(ans, ".", posN);
     118          TextSub(ans, 1, posN-1) + If(posP==0, "", TextSub(ans, posP, -1))
     119        }, ans)
     120      }, ans)
    111121    })
    112122  };
    113123
    114124  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||//
     125  Real _RemoteInstall.JustCalled = False;
     126  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||//
    115127  Real RemoteInstall(Text repository, Text package, Real showError)
    116128  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||//
    117129  {
     130    // Es necesario que el método LocalLastCompatible devuelva
     131    // el identificador del paquete sin mostrar la variante
     132    // cuando se llama justo después de instalar un paquete.
     133    Real _RemoteInstall.JustCalled := True;
    118134    Real length = TextLength(package);
    119135    Text packageWP = If(Text Sub(package, length, length)==".",
Note: See TracChangeset for help on using the changeset viewer.