-
Notifications
You must be signed in to change notification settings - Fork 0
/
aegisub-version-git.patch
55 lines (50 loc) · 1.78 KB
/
aegisub-version-git.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From d24017d937a955be33e375a7bf1b82a953e4da6b Mon Sep 17 00:00:00 2001
From: scx <[email protected]>
Date: Sat, 17 Aug 2019 15:23:44 +0200
Subject: [PATCH] Fix version string
Use a more readable version string.
e.g. 3.2.2+r8947 instead of 8947-master-2cb92a5
---
build/version.sh | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/build/version.sh b/build/version.sh
index 8cea0a3f3..5e289797b 100755
--- a/build/version.sh
+++ b/build/version.sh
@@ -26,6 +26,12 @@ last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be"
git_revision=$(expr $last_svn_revision + $(git log --pretty=oneline $last_svn_hash..HEAD 2>/dev/null | wc -l))
git_version_str=$(git describe --exact-match 2> /dev/null)
+git_version_postfix=0
+if test x$git_version_str = x; then
+ git_version_str=$(git describe --tags $(git rev-list --tags --max-count=1 2> /dev/null) 2> /dev/null)
+ git_version_postfix=1
+fi
+git_version_date=$(git log HEAD -1 --format="%at" 2> /dev/null | xargs -I{} date -d @{} +%Y-%m-%d 2> /dev/null)
installer_version='0.0.0'
resource_version='0, 0, 0'
if test x$git_version_str != x; then
@@ -45,6 +51,11 @@ else
fi
+if test x$git_version_postfix != x0; then
+ git_version_str="${git_version_str}+r${git_revision}"
+fi
+
+
new_version_h="\
#define BUILD_GIT_VERSION_NUMBER ${git_revision}
#define BUILD_GIT_VERSION_STRING \"${git_version_str}\"
@@ -77,3 +88,14 @@ cat << EOF > build/git_version.xml
</PropertyGroup>
</Project>
EOF
+
+cat << EOF > build/git_version.json
+{
+ "BUILD_GIT_VERSION_NUMBER": "${git_revision}",
+ "BUILD_GIT_VERSION_STRING": "${git_version_str}",
+ "BUILD_GIT_VERSION_DATE": "${git_version_date}",
+ "TAGGED_RELEASE": "${tagged_release}",
+ "INSTALLER_VERSION": "${installer_version}",
+ "RESOURCE_BASE_VERSION": "${resource_version}"
+}
+EOF