Changeset c7ffdc9f in tol


Ignore:
Timestamp:
Jun 16, 2010, 7:05:10 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
4f63528
Parents:
77d8a87
Message:

Refs #916
Se adapta el #Require al nuevo sistema TolPackage

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/lang/language.cpp

    r77d8a87 rc7ffdc9f  
    13081308
    13091309BText BPackage::localRoot_ =
    1310   BSys::TolAppData()+"OIS/Require/tol_pkg/"+
    1311   TOLVersionShortName()+"/";
    1312 
    1313 BText BPackage::urlRoot_ =
    1314   BText("http://packages.tol-project.org/tol_pkg/")+
    1315   TOLVersionShortName()+"/";
     1310  BSys::TolAppData()+"OIS/TolPackage/Client/";
    13161311
    13171312//--------------------------------------------------------------------
    … …  
    13241319
    13251320//--------------------------------------------------------------------
    1326   BText BPackage::Url(const BText& package_version)
    1327 //--------------------------------------------------------------------
    1328 {
    1329   BText url = urlRoot_+package_version+".oza";
    1330   return(url); 
    1331 }
    1332 
    1333 //--------------------------------------------------------------------
    13341321  bool BPackage::CleanLocal(const BText& package_version)
    13351322//--------------------------------------------------------------------
    … …  
    13421329//--------------------------------------------------------------------
    13431330{
    1344   BText path = LocalPath(package_version);
    1345   BText url = Url(package_version);
    1346   BSys::MkDir(localRoot_,true);
    1347   BText order = BText("wget ")+
    1348     url+" "+
    1349     "-O\""+ReplaceSlash(path)+"\"";
    1350   Std(I2("Installing required package ",
    1351          "Instalando el paquete requerido ")+package_version+"\n"+order+"\n");
    1352   #ifdef UNIX
    1353   system(order);
    1354   #else
    1355   BSys::WinSystem(order,0,true);
    1356   #endif
    1357   BDir dir = path;
    1358   bool ok = true;
    1359   if(!dir.Exist() || !dir.IsFile() || !dir.Bytes())
    1360   {
    1361     ok = false;
    1362     Error(I2("Cannot install empty package ",
    1363              "No se puede instalar el paquete vacío ")+
    1364           package_version+"\n"+help_);
    1365   }
    1366   return(ok); 
     1331  BSyntaxObject* fai = GraReal()->EvaluateExpr(BText(
     1332    "Real TolPackage::Client::FindAndInstall("
     1333    "\"")+package_version+"\",False);");
     1334  if(!fai) { return(false); }
     1335  bool ok = (bool)Real(fai);
     1336  DESTROY(fai);
     1337  return(ok);
    13671338}
    13681339
    … …  
    14171388  {
    14181389    BText path = LocalPath(package_version);
    1419     BText url = Url(package_version);
    1420     if(dir.Exist())
     1390    if(!dir.Exist())
     1391    {
     1392      Error(I2("Unknown package ",
     1393               "El paquete desconocido ")+package_version+
     1394            I2(" must be manually installed.",
     1395               " debe ser instalado manualmente."));
     1396    }
     1397    else
    14211398    {
    14221399      BSys::Remove(path);
    … …  
    14271404              I2(" has been locally removed ",
    14281405                 " ha sido eliminado localmente ")+
    1429               I2("and will be reinstalled from ",
    1430                  "y será reinstalado desde ")+
    1431               url);
     1406              I2("and will be reinstalled.",
     1407                 "y será reinstalado."));
    14321408        return(Load(package_version, false));
    14331409      }
    … …  
    14381414              I2(" has been locally removed ",
    14391415                 " ha sido eliminado localmente ")+
    1440               I2("but it will not be reinstalled again.",
    1441                  "pero no será reinstalado de nuevo."));
     1416              I2("and it will not be reinstalled again.",
     1417                 "y no será reinstalado de nuevo."));
    14421418      } 
    14431419    }
Note: See TracChangeset for help on using the changeset viewer.