Changeset fa037e6 in tol


Ignore:
Timestamp:
Feb 9, 2012, 11:24:10 AM (15 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
567b369
Parents:
01e6165
Message:

Refs #1424
New methods to check packages with DLL and avoid locking problems at package deletion

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

File:
1 edited

Legend:

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

    r01e6165 rfa037e6  
    10221022};
    10231023
    1024 ////////////////////////////////////////////////////////////////////////////////
    1025   Text CppTools.Path(NameBlock package)
    1026 ////////////////////////////////////////////////////////////////////////////////
    1027 {
    1028   Text packageName = package::_.autodoc.name;
    1029   Text dllPath.rel = GetAbsolutePath("CppTools/"+ GetHardSoftPlattform(0));
    1030   Text dllPath.deb = dllPath.rel+"_dbg";
    1031   Text dllFile.rel = dllPath.rel+"/"+packageName+"."+GetSharedLibExt(0);
    1032   Text dllFile.deb = dllPath.deb+"/"+packageName+"."+GetSharedLibExt(0);
     1024
     1025////////////////////////////////////////////////////////////////////////////////
     1026  Text CppTools.CalcPath(Text packageFullName)
     1027////////////////////////////////////////////////////////////////////////////////
     1028{
     1029  Text packageName = Tokenizer(packageFullName,".")[1];
     1030  Text dllRoot.rel = GetAbsolutePath(
     1031     _.localRoot+packageFullName+
     1032     "/CppTools/"+ GetHardSoftPlattform(0));
     1033  Text dllRoot.deb = dllRoot.rel+"_dbg";
     1034  Text dllFile.rel = dllRoot.rel+"/"+packageName+"."+GetSharedLibExt(0);
     1035  Text dllFile.deb = dllRoot.deb+"/"+packageName+"."+GetSharedLibExt(0);
    10331036  If(!TextEndAt(Version,"{DEBUG}"),dllFile.rel,
    10341037  {
    … …  
    10431046
    10441047////////////////////////////////////////////////////////////////////////////////
     1048  Text CppTools.Path(NameBlock pkg)
     1049////////////////////////////////////////////////////////////////////////////////
     1050{
     1051  Text packageFullName =
     1052    pkg::_.autodoc.name+"."<<
     1053    pkg::_.autodoc.version.high+"."<<
     1054    pkg::_.autodoc.version.low;
     1055  CppTools.CalcPath(packageFullName)
     1056};
     1057
     1058////////////////////////////////////////////////////////////////////////////////
    10451059  Real CppTools.Check(NameBlock package, Text dllFile, Text chechMethod)
    10461060////////////////////////////////////////////////////////////////////////////////
    … …  
    10511065          " -> "<<If(ok,"OK","FAIL"),If(ok,"S","E"));
    10521066  ok
     1067};
     1068
     1069////////////////////////////////////////////////////////////////////////////////
     1070  Real CppTools.HasDll(Text packageFullName)
     1071////////////////////////////////////////////////////////////////////////////////
     1072{
     1073  Text dllFile = CppTools.CalcPath(packageFullName);
     1074  OSFilExist(dllFile)
     1075};
     1076
     1077////////////////////////////////////////////////////////////////////////////////
     1078  Real CppTools.HasLockedDll(Text packageFullName)
     1079////////////////////////////////////////////////////////////////////////////////
     1080{
     1081  Text dllFile = CppTools.CalcPath(packageFullName);
     1082  If(!OSFilExist(dllFile), False,
     1083  {
     1084    Real open = FOpen(dllFile,"r+b",True,False);
     1085    If(open, FClose(open));
     1086    Not(open)
     1087  })
    10531088}
    10541089
    10551090
     1091
    10561092]];
    10571093
Note: See TracChangeset for help on using the changeset viewer.