]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4219 --resolve windows revision display human thanks Peter
authorJeff Lenk <jeff@jefflenk.com>
Wed, 26 Sep 2012 13:16:28 +0000 (08:16 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Wed, 26 Sep 2012 13:16:28 +0000 (08:16 -0500)
libs/win32/util.vbs

index 2c35dfdcb785b392f21ab1dfacd4952ceb584d9c..0ce107c4c4e724563929d8db5e06b2eb70a7f90d 100644 (file)
@@ -314,31 +314,6 @@ Function GetTimeUTC()
 \r
 End Function\r
 \r
-Function GetWeekDay(DateTime)\r
-\r
-       DayOfWeek = DatePart("w", DateTime)\r
-\r
-       Select Case DayOfWeek\r
-               Case 1 GetWeekDay = "Sun"\r
-               Case 2 GetWeekDay = "Mon"\r
-               Case 3 GetWeekDay = "Tue"\r
-               Case 4 GetWeekDay = "Wed"\r
-               Case 5 GetWeekDay = "Thu"\r
-               Case 6 GetWeekDay = "Fri"\r
-               Case 7 GetWeekDay = "Sat"\r
-       End Select\r
-\r
-End Function\r
-\r
-Function GetMonthName(DateTime)\r
-\r
-       Val = MonthName(Month(DateTime), True)\r
-       Val = UCase(Left(Val, 1)) & Mid(Val, 2, 4)\r
-       \r
-       GetMonthName = Val\r
-       \r
-End Function\r
-\r
 Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)\r
        Dim oExec\r
        \r
@@ -364,7 +339,7 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
                If IsNumeric(strFromProc) Then\r
                        lastChangedDateTime = DateAdd("s", strFromProc, "01/01/1970 00:00:00")\r
                        strLastCommit = YEAR(lastChangedDateTime) & Pd(Month(lastChangedDateTime), 2) & Pd(DAY(lastChangedDateTime), 2) & "T" & Pd(Hour(lastChangedDateTime), 2) & Pd(Minute(lastChangedDateTime), 2) & Pd(Second(lastChangedDateTime), 2) & "Z"\r
-                       strLastCommitHuman = GetWeekDay(lastChangedDateTime) & ", " & Pd(DAY(lastChangedDateTime), 2) & " " & GetMonthName(lastChangedDateTime) & " " & YEAR(lastChangedDateTime) & " " & Pd(Hour(lastChangedDateTime), 2) & ":" & Pd(Minute(lastChangedDateTime), 2) & ":" & Pd(Second(lastChangedDateTime), 2) & " Z"\r
+                       strLastCommitHuman = YEAR(lastChangedDateTime) & "-" & Pd(Month(lastChangedDateTime), 2) & "-" & Pd(DAY(lastChangedDateTime), 2) & " " & Pd(Hour(lastChangedDateTime), 2) & ":" & Pd(Minute(lastChangedDateTime), 2) & ":" & Pd(Second(lastChangedDateTime), 2) & "Z"\r
                Else\r
                        strLastCommit = ""\r
                        strLastCommitHuman = ""\r
@@ -372,17 +347,19 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
 \r
                'Get revision hash\r
                strRevision = ExecAndGetResult(tmpFolder, VersionDir, "git rev-list -n1 --abbrev=10 --abbrev-commit HEAD")\r
+               strRevisionHuman = ExecAndGetResult(tmpFolder, VersionDir, "git rev-list -n1 --abbrev=7 --abbrev-commit HEAD")\r
                \r
-               If strLastCommit <> "" And strLastCommitHuman <> "" And strRevision <> "" Then\r
+               If strLastCommit <> "" And strLastCommitHuman <> "" And strRevision <> "" And strRevisionHuman <> "" Then\r
                        'Bild version string\r
                        strGitVer = "+git~" & strLastCommit & "~" & strRevision\r
-                       strVerHuman = strVerRev & "; git at commit " & strRevision & " on " & strLastCommitHuman\r
+                       strVerHuman = "git " & strRevisionHuman & " " & strLastCommitHuman\r
 \r
                        'Check for local changes, if found, append to git revision string\r
                        If ShowUnclean Then\r
                                If ExecAndGetExitCode(tmpFolder, VersionDir, "git diff-index --quiet HEAD") <> 0 Then\r
                                        lastChangedDateTime = GetTimeUTC()\r
                                        strGitVer = strGitVer & "+unclean~" & YEAR(lastChangedDateTime) & Pd(Month(lastChangedDateTime), 2) & Pd(DAY(lastChangedDateTime), 2) & "T" & Pd(Hour(lastChangedDateTime), 2) & Pd(Minute(lastChangedDateTime), 2) & Pd(Second(lastChangedDateTime), 2) & "Z"\r
+                                       strVerHuman = strVerHuman & " unclean " & YEAR(lastChangedDateTime) & "-" & Pd(Month(lastChangedDateTime), 2) & "-" & Pd(DAY(lastChangedDateTime), 2) & " " & Pd(Hour(lastChangedDateTime), 2) & ":" & Pd(Minute(lastChangedDateTime), 2) & ":" & Pd(Second(lastChangedDateTime), 2) & "Z"\r
                                End If\r
                        End If\r
                Else\r
@@ -393,7 +370,7 @@ Sub CreateVersion(tmpFolder, VersionDir, includebase, includedest)
                VERSION=VERSION & strGitVer\r
 \r
                sLastVersion = ""\r
-               Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, true, OpenAsASCII)\r
+               Set sLastFile = FSO.OpenTextFile(tmpFolder & "lastversion", ForReading, True, OpenAsASCII)\r
                If Not sLastFile.atEndOfStream Then\r
                        sLastVersion = sLastFile.ReadLine()\r
                End If\r