[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #2901: Packages dependies (step 7 of packager)


http://gambaswiki.org/bugtracker/edit?object=BUG.2901&from=L21haW4-

Comment #3 by Willy RAETS:

As I told before, thia was fixed somewhere in 3.7 or 3.8 version.
I found my 3.6.2 IDE where I copied the code to fromm the fix, so I could properly package libraries.

I believe this part of the code has the fix (it is from the module package (in folder Packager of IDE), but this is from many moons ago (like 10 plus years):
---
Private Function GetDependency(sLib As String) As String
        
  Dim hLibrary As CLibraryInfo
  Dim sVersion As String
  Dim aMinVersion As String[]
  Dim aMaxVersion As String[]
  Dim sPackageName As String
  Debug Left(sLib)
  If Left(sLib) = "/" Or If Left(sLib) = ":" Then
    
    ' The package name dependency must not include the version!
    
    hLibrary = CLibraryInfo[sLib]
    sPackageName = hLibrary.GetDependencyName()
    sVersion = hLibrary.Version
    
    aMinVersion = Split(sVersion, ".")
    ' If aMinVersion[1] = "0" Then
    '   If aMinVersion[0] <> "0" Then
    '     aMinVersion[0] = CStr(CInt(aMinVersion[0]) - 1)
    '     aMinVersion[1] = "90"
    '   Endif
    ' Else
    '   aMinVersion[1] = CStr(CInt(aMinVersion[1]) - 1)
    ' Endif
    ' aMinVersion.Resize(3)
    ' aMinVersion[2] = "0"
    
    If hLibrary.CompatibleUntil Then
      aMaxVersion = Split(hLibrary.CompatibleUntil, ".")
    Else
      aMaxVersion = Split(sVersion, ".")
      aMaxVersion.Resize(3)
      aMaxVersion[0] = Val(aMinVersion[0]) + 1
      aMaxVersion[1] = "99"
      aMaxVersion[2] = "99"
    Endif
    
  Else
    
    sPackageName = ComponentToPackageName(sLib)
    
    aMinVersion = Split(MIN_VERSION, ".")
    aMaxVersion = Split(MAX_VERSION, ".")
    
  Endif
  
  Debug Subst($sFormatMinMax, sPackageName, aMinVersion.Join("."), aMaxVersion.Join("."))
  Return Subst($sFormatMinMax, sPackageName, aMinVersion.Join("."), aMaxVersion.Join("."))

End
---


----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----