strVerMicro = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_MICRO")\r
strVerRev = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_REVISION")\r
\r
- If Right(tmpFolder, 1) <> "\" Then tmpFolder = tmpFolder & "\" End If\r
- If Not FSO.FileExists(tmpFolder & "fs_svnversion.exe") Then \r
- Wget ToolsBase & "fs_svnversion.exe", tmpFolder\r
- End If \r
-\r
- If Not FSO.FileExists(tmpFolder & "libdb44.dll") Then \r
- Wget ToolsBase & "libdb44.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libsvn_diff-1.dll") Then \r
- Wget ToolsBase & "libsvn_diff-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libsvn_subr-1.dll") Then \r
- Wget ToolsBase & "libsvn_subr-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libsvn_wc-1.dll") Then \r
- Wget ToolsBase & "libsvn_wc-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "intl3_svn.dll") Then \r
- Wget ToolsBase & "intl3_svn.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libapr-1.dll") Then \r
- Wget ToolsBase & "libapr-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libaprutil-1.dll") Then \r
- Wget ToolsBase & "libaprutil-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libapriconv-1.dll") Then \r
- Wget ToolsBase & "libapriconv-1.dll", tmpFolder\r
- End If \r
- If Not FSO.FileExists(tmpFolder & "libsvn_delta-1.dll") Then \r
- Wget ToolsBase & "libsvn_delta-1.dll", tmpFolder\r
- End If \r
+ 'Set version to the one reported by configure.in\r
+ if strVerRev <> "" Then\r
+ VERSION = strVerRev\r
+ End If\r
\r
Dim sLastFile\r
- Const OverwriteIfExist = -1\r
Const ForReading = 1\r
\r
- if strVerRev = "" Then\r
- if FSO.FolderExists(VersionDir & ".svn") Then\r
- VersionCmd="fs_svnversion " & quote & VersionDir & "." & quote & " -n"\r
- Set MyFile = fso.CreateTextFile(tmpFolder & "tmpVersion.Bat", True)\r
- MyFile.WriteLine("@" & "cd " & quote & tmpFolder & quote )\r
- MyFile.WriteLine("@" & VersionCmd)\r
- MyFile.Close\r
- Set oExec = WshShell.Exec("cmd /C " & quote & tmpFolder & "tmpVersion.Bat" & quote)\r
- Do\r
- strFromProc = OExec.StdOut.ReadLine()\r
- VERSION="svn-" & 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
- End If\r
-\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
+ '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
End If\r
+ sLastFile.Close\r
+ VERSION = Replace(VERSION, ":", "-")\r
End If\r
\r
- if strVerRev <> "" Then\r
- VERSION = strVerRev\r
- End If\r
-\r
If VERSION = "" Then\r
VERSION = "UNKNOWN"\r
End If\r