' Gambas module file Private $hIn As File Private $hOut As File ' Private Sub Terminate(aStack As String[], Optional sMark As String, Optional iNeed As Integer) ' ' Dim sElt As String ' ' While aStack.Count > iNeed ' ' sElt = aStack.Pop() ' Print #$hOut, sElt ' If sElt = sMark Then Break ' ' Wend ' ' End Private Function UnCapitalize(sLig As String) As String Dim sRes As String Dim sWord As String Dim bBracket As Boolean If Left(sLig) = "[" Then bBracket = True sLig = Mid$(sLig, 2, -1) Endif For Each sWord In Split(sLig, " ") If sWord Like "gb.*" Then sRes &= "" & UCase(sWord) & " " Else sRes &= UCase(Left$(sWord)) & LCase(Mid$(sWord, 2)) & " " Endif Next 'IF bBracket THEN sRes = "[" & Trim(sRes) & "]" Return Trim(sRes) End Public Sub MakeChangeLog(sDir As String, iVer As Integer) Dim sLig As String Dim aElt As String[] Dim bVer As Boolean Dim bList As Boolean Dim sOut As String Dim sVer As String sOut = sDir &/ "changelog" & iVer & ".html" Print sOut $hIn = Open User.Home &/ "gambas/" & iVer & ".0/trunk/ChangeLog" For Read $hOut = Open sOut For Create Print #$hOut, "\n" "\n" "" "\n" "\n" "\n" "\n" "
\n" "ChangeLog\n" "
\n
" $hIn = Open User.Home &/ "gambas/" & iVer & ".0/trunk/ChangeLog" For Read While Not Eof($hIn) Line Input #$hIn, sLig sLig = RTrim(sLig) If Not sLig Then Continue If Left$(sLig, 3) = "---" Then Line Input #$hIn, sLig aElt = Split(sLig, "-") Print #$hOut, ""; Trim(aElt[1]); " " Line Input #$hIn, sLig Endif Wend Close $hIn Print #$hOut, "
" $hIn = Open User.Home &/ "gambas/" & iVer & ".0/trunk/ChangeLog" For Read While Not Eof($hIn) Line Input #$hIn, sLig sLig = RTrim(sLig) If Not sLig Then Continue If Left$(sLig, 3) = "---" Then If bList Then Print #$hOut, " " If bVer Then Print #$hOut, "" Print #$hOut, "" Endif Line Input #$hIn, sLig aElt = Split(sLig, "-") Print #$hOut, "" Print #$hOut, "
" Print #$hOut, " " Print #$hOut, " " Print #$hOut, "
" Print #$hOut, "
"; Trim(aElt[1]); " - "; Trim(aElt[2]); "
" Print #$hOut, "
" Print #$hOut, "
" Print #$hOut, "
" 'Print #$hOut, "" ''PRINT #$hOut, " " 'Print #$hOut, " " 'Print #$hOut, " " Print #$hOut, "
"; Trim(aElt[1]); " - "; Trim(aElt[2]); "
"; Trim(aElt[1]); " - "; Trim(aElt[2]); "
" If Not sVer Then sVer = Trim(aElt[1]) bVer = True bList = False Line Input #$hIn, sLig Continue Endif If UCase(sLig) = sLig And If Left(sLig) <> " " Then If bList Then Print #$hOut, " " bList = False Endif Print #$hOut, "

" & UnCapitalize(sLig) & "" Continue Endif If Left$(sLig, 2) = "* " Then If Not bList Then Print #$hOut, "

    " bList = True Endif sLig = Mid$(sLig, 3) Print #$hOut, "
  • "; Endif sLig = Replace(sLig, "&", "&") sLig = Replace(sLig, "<", "<") sLig = Replace(sLig, ">", ">") Print #$hOut, sLig Wend Close #$hIn If bList Then Print #$hOut, "
" If bVer Then Print #$hOut, "
\n" Print #$hOut, "\n\n" Close #$hOut ' PRINT "Modification de debian/changelog" ' ' sOld = File.Load(User.Home &/ "gambas/" & System.Version & ".0/debian/changelog") ' ' IF NOT (sOld LIKE "gambas (" & sVer & ") *") THEN ' ' sData = "gambas (" & sVer & ") unstable; urgency=low\n\n" ' sData = sData & " * Automatically generated. See ChangeLog file for more details.\n\n" ' sData = sData & " -- Jose L. Redrejo " ' ' sTemp = Temp$ ' SHELL "date -R > " & sTemp WAIT ' sData = sData & File.Load(sTemp) & "\n\n" ' ' File.Save(User.Home &/ "gambas/" & System.Version & ".0/debian/changelog", sData & sOld) ' ' ENDIF End