]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4219 --resolve correct windows version
authorJeff Lenk <jeff@jefflenk.com>
Tue, 5 Jun 2012 13:44:22 +0000 (08:44 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Tue, 5 Jun 2012 13:44:22 +0000 (08:44 -0500)
libs/win32/util.vbs

index 29a7be571546f676e608c1d3b69a5a26fd78b09a..cbaf96a7b0b500a09e2f5a2bf68119e900540145 100644 (file)
@@ -271,36 +271,38 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
        strVerRev   = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_REVISION")\r
        \r
        'Set version to the one reported by configure.in\r
-       if strVerRev <> "" Then\r
+       If strVerRev <> "" Then\r
            VERSION = strVerRev\r
        End If\r
 \r
        Dim sLastFile\r
        Const ForReading       =  1\r
 \r
-       'Try To read revision from git, if it's found, use this instead of strVerRev found above\r
-       If FSO.FolderExists(VersionDir & ".git") Then\r
-               VersionCmd="git log --format=" & quote & "%%h %%ci" & quote & " -1 HEAD"\r
-               Set MyFile = FSO.CreateTextFile(tmpFolder & "tmpVersion.Bat", True)\r
-               MyFile.WriteLine("@" & "cd " & quote & VersionDir & quote)\r
-               MyFile.WriteLine("@" & VersionCmd)\r
-               MyFile.Close\r
-               Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote)\r
-               Do\r
-                       strFromProc = Trim(OExec.StdOut.ReadLine())\r
-                       VERSION="git-" & strFromProc\r
-               Loop While Not OExec.StdOut.atEndOfStream\r
-               sLastVersion = ""\r
-               Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII)\r
-               If Not sLastFile.atEndOfStream Then\r
-                       sLastVersion = sLastFile.ReadLine()\r
+       'Try To read revision from git, if it was not found in "configure.in" already\r
+       If strVerRev = "" Then\r
+               If FSO.FolderExists(VersionDir & ".git") Then\r
+                       VersionCmd="git log --format=" & quote & "%%h %%ci" & quote & " -1 HEAD"\r
+                       Set MyFile = FSO.CreateTextFile(tmpFolder & "tmpVersion.Bat", True)\r
+                       MyFile.WriteLine("@" & "cd " & quote & VersionDir & quote)\r
+                       MyFile.WriteLine("@" & VersionCmd)\r
+                       MyFile.Close\r
+                       Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote)\r
+                       Do\r
+                               strFromProc = Trim(OExec.StdOut.ReadLine())\r
+                               VERSION="git-" & strFromProc\r
+                       Loop While Not OExec.StdOut.atEndOfStream\r
+                       sLastVersion = ""\r
+                       Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII)\r
+                       If Not sLastFile.atEndOfStream Then\r
+                               sLastVersion = sLastFile.ReadLine()\r
+                       End If\r
+                       sLastFile.Close\r
+                       VERSION = Replace(VERSION, ":", "-")\r
                End If\r
-               sLastFile.Close\r
-               VERSION = Replace(VERSION, ":", "-")\r
        End If\r
        \r
        If VERSION = "" Then\r
-               VERSION = "UNKNOWN"\r
+               VERSION = "-UNKNOWN"\r
        End If\r
 \r
        If VERSION <> sLastVersion Then\r