Merge branch 'save_ext' into jgrpp

# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/lang/dutch.txt
#	src/lang/korean.txt
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/rail.cpp
#	src/rail_cmd.cpp
#	src/saveload/afterload.cpp
#	src/ship_cmd.cpp
#	src/toolbar_gui.cpp
#	src/vehicle.cpp
This commit is contained in:
Jonathan G Rennison
2019-02-13 19:09:06 +00:00
107 changed files with 785 additions and 348 deletions

View File

@@ -21,35 +21,41 @@ Sub FindReplaceInFile(filename, to_find, replacement)
file.Close
End Sub
Sub UpdateFile(modified, isodate, version, cur_date, githash, filename)
Sub UpdateFile(modified, isodate, version, cur_date, githash, istag, filename)
FSO.CopyFile filename & ".in", filename
FindReplaceInFile filename, "!!MODIFIED!!", modified
FindReplaceInFile filename, "!!ISODATE!!", isodate
FindReplaceInFile filename, "!!VERSION!!", version
FindReplaceInFile filename, "!!DATE!!", cur_date
FindReplaceInFile filename, "!!GITHASH!!", githash
FindReplaceInFile filename, "!!ISTAG!!", istag
FindReplaceInFile filename, "!!CONFIGURE_INVOCATION!!", ""
End Sub
Sub UpdateFiles(version)
Dim modified, isodate, cur_date, githash
Dim modified, isodate, cur_date, githash, istag
cur_date = DatePart("D", Date) & "." & DatePart("M", Date) & "." & DatePart("YYYY", Date)
If InStr(version, Chr(9)) Then
' Split string into field with tails
isodate = Mid(version, InStr(version, Chr(9)) + 1)
modified = Mid(isodate, InStr(isodate, Chr(9)) + 1)
githash = Mid(modified, InStr(modified, Chr(9)) + 1)
istag = Mid(githash, InStr(githash, Chr(9)) + 1)
' Remove tails from fields
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
isodate = Mid(isodate, 1, InStr(isodate, Chr(9)) - 1)
modified = Mid(modified, 1, InStr(modified, Chr(9)) - 1)
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
githash = Mid(githash, 1, InStr(githash, Chr(9)) - 1)
Else
isodate = 0
modified = 1
githash = ""
istag = 0
End If
UpdateFile modified, isodate, version, cur_date, githash, "../src/rev.cpp"
UpdateFile modified, isodate, version, cur_date, githash, "../src/os/windows/ottdres.rc"
UpdateFile modified, isodate, version, cur_date, githash, istag, "../src/rev.cpp"
UpdateFile modified, isodate, version, cur_date, githash, istag, "../src/os/windows/ottdres.rc"
End Sub
Function DetermineVersion()
@@ -138,7 +144,7 @@ Function DetermineVersion()
DetermineVersion = "norev000"
modified = 1
Else
Dim version, hashprefix
Dim version, hashprefix, istag
If modified = 0 Then
hashprefix = "-g"
ElseIf modified = 2 Then
@@ -149,11 +155,13 @@ Function DetermineVersion()
If tag <> "" Then
version = tag
istag = 1
Else
version = isodate & "-" & branch & hashprefix & shorthash
istag = 0
End If
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash
DetermineVersion = version & Chr(9) & isodate & Chr(9) & modified & Chr(9) & hash & Chr(9) & istag
End If
End Function