Skip to content

Commit 7273dd8

Browse files
committed
fix updater not using --stable param for stable releases
1 parent 8fbbc1e commit 7273dd8

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ if(NOT RTTR_VERSION)
5656
string(TIMESTAMP RTTR_VERSION "%Y%m%d")
5757
endif()
5858

59+
# stable build? then set rttr.bat/rttr.sh parameter
60+
set(STABLE_PARAM)
61+
if(${RTTR_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
62+
message(STATUS "Creating a stable version ${RTTR_VERSION}")
63+
set(STABLE_PARAM "--stable")
64+
endif()
65+
5966
if(checkSubmodules)
6067
include(CheckGitSubmodules)
6168
check_git_submodules()
@@ -393,7 +400,7 @@ if(WIN32)
393400
endif()
394401

395402
# stable build?
396-
if(${RTTR_VERSION} MATCHES "([0-9]+)\.([0-9]+)\.([0-9]+)")
403+
if(${RTTR_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
397404
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
398405
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_2}")
399406
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_MATCH_3}")

tools/release/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#
33
# SPDX-License-Identifier: GPL-2.0-or-later
44

5+
include(ConfigureExecutable)
6+
57
# Start script
68
if(WIN32)
7-
install(PROGRAMS "bin/rttr.bat" DESTINATION "${RTTR_BINDIR}")
9+
configure_executable("bin/rttr.bat.cmake" ${CMAKE_CURRENT_BINARY_DIR} rttr.bat)
10+
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/rttr.bat" DESTINATION "${RTTR_BINDIR}")
811
if(PLATFORM_ARCH)
9-
include(ConfigureExecutable)
10-
configure_executable("bundleWinFiles.sh.cmake" . bundleWinFiles.sh)
12+
configure_executable("bundleWinFiles.sh.cmake" ${CMAKE_CURRENT_BINARY_DIR} bundleWinFiles.sh)
1113

1214
install(CODE "
1315
set(ENV{CMAKE_INSTALL_PREFIX} \${CMAKE_INSTALL_PREFIX})
@@ -52,7 +54,8 @@ elseif(APPLE)
5254
)
5355
endif()
5456
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CYGWIN)
55-
install(PROGRAMS "bin/rttr.sh" DESTINATION "${RTTR_BINDIR}")
57+
configure_executable("bin/rttr.sh.cmake" ${CMAKE_CURRENT_BINARY_DIR} rttr.sh)
58+
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/rttr.sh" DESTINATION "${RTTR_BINDIR}")
5659
# copy miniupnpc
5760
get_filename_component(MINIUPNPC_DIR ${MINIUPNPC_LIBRARY} DIRECTORY)
5861
find_library(MINIUPNPC_BIN NAMES miniupnpc.so libminiupnpc.so HINTS ${MINIUPNPC_DIR})

tools/release/bin/rttr.bat renamed to tools/release/bin/rttr.bat.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ IF EXIST RTTR\s25update.exe GOTO UPDATE
88
GOTO START
99

1010
:UPDATE
11-
RTTR\s25update.exe --dir %CD%
11+
RTTR\s25update.exe --dir %CD% @STABLE_PARAM@
1212

1313
:START
1414
s25client.exe

tools/release/bin/rttr.sh renamed to tools/release/bin/rttr.sh.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [ $noupdate -eq 0 ] ; then
4141
echo "checking for an update ..."
4242
cp $DIR/../libexec/s25rttr/s25update /tmp/s25update.$$
4343
chmod 0755 /tmp/s25update.$$
44-
/tmp/s25update.$$ --verbose --dir "$DIR/../"
44+
/tmp/s25update.$$ --verbose --dir "$DIR/../" @STABLE_PARAM@
4545
if [ -z "$(diff -q /tmp/s25update.$$ $DIR/../libexec/s25rttr/s25update)" ] ; then
4646
PARAM=noupdate
4747
fi

0 commit comments

Comments
 (0)