File: drop-in-versioncpp.patch

package info (click to toggle)
railcontrol 24%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,972 kB
  • sloc: cpp: 39,964; javascript: 2,454; makefile: 105; php: 97; sh: 25
file content (122 lines) | stat: -rw-r--r-- 5,143 bytes parent folder | download | duplicates (4)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
The upstream sources use git metadata during each build and to check for newer versions. Since package versions don't change within a Debian release, this check does not make sense. We work around that with a "static" version information.
Index: railcontrol/Version.cpp
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ railcontrol/Version.cpp	2025-05-01 06:13:47.723017779 +0200
@@ -0,0 +1,28 @@
+/*
+RailControl - Model Railway Control Software
+
+Copyright (c) 2017-2023 Dominik (Teddy) Mahrer - www.railcontrol.org
+
+RailControl is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3, or (at your option) any
+later version.
+
+RailControl is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with RailControl; see the file LICENCE. If not see
+<http://www.gnu.org/licenses/>.
+*/
+
+#include "Version.h"
+
+const std::string& GetVersionInfoRailControlVersion()
+{
+	static const std::string railControlVersion = "24";
+	return railControlVersion;
+}
+
Index: railcontrol/Makefile
===================================================================
--- railcontrol.orig/Makefile	2025-05-01 06:13:47.727017729 +0200
+++ railcontrol/Makefile	2025-05-01 06:13:47.723017779 +0200
@@ -90,12 +90,3 @@
 tools:
 	make -C tools
 
-.PHONY: Version.cpp
-Version.cpp: Version.cpp.in
-	sed s/@COMPILE_TIMESTAMP@/`date +%s`/ < Version.cpp.in \
-	| sed s/@GIT_HASH@/`git log -1 --format=%H`/ \
-	| sed s/@GIT_TIMESTAMP@/`git log -1 --format=%at`/ \
-	| sed "s/@GIT_DIRTY@/`git status -s| wc -l`/" \
-	| sed s/@RAILCONTROL_VERSION@/$(RAILCONTROL_VERSION)/ \
-	> Version.cpp
-
Index: railcontrol/Version.h
===================================================================
--- railcontrol.orig/Version.h	2025-05-01 06:13:47.727017729 +0200
+++ railcontrol/Version.h	2025-05-01 06:13:47.723017779 +0200
@@ -20,8 +20,8 @@
 
 #include <string>
 
-const std::string& GetVersionInfoGitHash();
-time_t GetVersionInfoGitTimestamp();
-unsigned int GetVersionInfoGitDirty();
-time_t GetVersionInfoCompileTimestamp();
+//const std::string& GetVersionInfoGitHash();
+//time_t GetVersionInfoGitTimestamp();
+//unsigned int GetVersionInfoGitDirty();
+//time_t GetVersionInfoCompileTimestamp();
 const std::string& GetVersionInfoRailControlVersion();
Index: railcontrol/RailControl.cpp
===================================================================
--- railcontrol.orig/RailControl.cpp	2025-05-01 06:13:47.727017729 +0200
+++ railcontrol/RailControl.cpp	2025-05-01 06:16:51.524730014 +0200
@@ -123,15 +123,15 @@
 
 	logger->Info(Languages::TextStarting, RailControl);
 	logger->Info(Languages::TextVersion, GetVersionInfoRailControlVersion());
-	logger->Info(Languages::TextCompileDate, Utils::Utils::TimestampToDate(GetVersionInfoCompileTimestamp()));
-	logger->Info(Languages::TextGitHash, GetVersionInfoGitHash());
-	logger->Info(Languages::TextGitDate, Utils::Utils::TimestampToDate(GetVersionInfoGitTimestamp()));
+	// logger->Info(Languages::TextCompileDate, Utils::Utils::TimestampToDate(GetVersionInfoCompileTimestamp()));
+	// logger->Info(Languages::TextGitHash, GetVersionInfoGitHash());
+	// logger->Info(Languages::TextGitDate, Utils::Utils::TimestampToDate(GetVersionInfoGitTimestamp()));
 
-	const unsigned int changedFiles = GetVersionInfoGitDirty();
-	if (changedFiles)
-	{
-		logger->Info(Languages::TextGitDirty, changedFiles);
-	}
+	// const unsigned int changedFiles = GetVersionInfoGitDirty();
+	// if (changedFiles)
+	// {
+	// 	logger->Info(Languages::TextGitDirty, changedFiles);
+	// }
 
 	logger->Info(Languages::TextStartArgument, argv[0]);
 
Index: railcontrol/Server/Web/WebServer.cpp
===================================================================
--- railcontrol.orig/Server/Web/WebServer.cpp	2025-05-01 06:13:47.727017729 +0200
+++ railcontrol/Server/Web/WebServer.cpp	2025-05-01 06:41:43.404634946 +0200
@@ -68,7 +68,7 @@
 		AddUpdate(Languages::TextRailControlStarted);
 
 		LogBrowserInfo(webserveraddress, port);
-		updateAvailable = Utils::Network::HostResolves(GetVersionInfoGitHash() + ".hash.railcontrol.org");
+		// updateAvailable = Utils::Network::HostResolves(GetVersionInfoGitHash() + ".hash.railcontrol.org");
 	}
 
 	WebServer::~WebServer()
Index: railcontrol/Server/Web/WebClient.cpp
===================================================================
--- railcontrol.orig/Server/Web/WebClient.cpp	2025-05-01 06:13:47.727017729 +0200
+++ railcontrol/Server/Web/WebClient.cpp	2025-05-01 06:13:47.727017729 +0200
@@ -3073,7 +3073,7 @@
 		}
 		struct timeval tv;
 		int ret = gettimeofday(&tv, nullptr);
-		if (ret != 0 || tv.tv_sec > GetVersionInfoCompileTimestamp())
+		if (ret != 0)
 		{
 			ReplyHtmlWithHeaderAndParagraph(Languages::TextTimestampAlreadySet);
 			return;