Skip to content

Commit

Permalink
fix updater not using --stable param for stable releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Flow86 committed Jul 22, 2021
1 parent 8fbbc1e commit 7273dd8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ if(NOT RTTR_VERSION)
string(TIMESTAMP RTTR_VERSION "%Y%m%d")
endif()

# stable build? then set rttr.bat/rttr.sh parameter
set(STABLE_PARAM)
if(${RTTR_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
message(STATUS "Creating a stable version ${RTTR_VERSION}")
set(STABLE_PARAM "--stable")
endif()

if(checkSubmodules)
include(CheckGitSubmodules)
check_git_submodules()
Expand Down Expand Up @@ -393,7 +400,7 @@ if(WIN32)
endif()

# stable build?
if(${RTTR_VERSION} MATCHES "([0-9]+)\.([0-9]+)\.([0-9]+)")
if(${RTTR_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_2}")
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_MATCH_3}")
Expand Down
11 changes: 7 additions & 4 deletions tools/release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later

include(ConfigureExecutable)

# Start script
if(WIN32)
install(PROGRAMS "bin/rttr.bat" DESTINATION "${RTTR_BINDIR}")
configure_executable("bin/rttr.bat.cmake" ${CMAKE_CURRENT_BINARY_DIR} rttr.bat)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/rttr.bat" DESTINATION "${RTTR_BINDIR}")
if(PLATFORM_ARCH)
include(ConfigureExecutable)
configure_executable("bundleWinFiles.sh.cmake" . bundleWinFiles.sh)
configure_executable("bundleWinFiles.sh.cmake" ${CMAKE_CURRENT_BINARY_DIR} bundleWinFiles.sh)

install(CODE "
set(ENV{CMAKE_INSTALL_PREFIX} \${CMAKE_INSTALL_PREFIX})
Expand Down Expand Up @@ -52,7 +54,8 @@ elseif(APPLE)
)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CYGWIN)
install(PROGRAMS "bin/rttr.sh" DESTINATION "${RTTR_BINDIR}")
configure_executable("bin/rttr.sh.cmake" ${CMAKE_CURRENT_BINARY_DIR} rttr.sh)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/rttr.sh" DESTINATION "${RTTR_BINDIR}")
# copy miniupnpc
get_filename_component(MINIUPNPC_DIR ${MINIUPNPC_LIBRARY} DIRECTORY)
find_library(MINIUPNPC_BIN NAMES miniupnpc.so libminiupnpc.so HINTS ${MINIUPNPC_DIR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IF EXIST RTTR\s25update.exe GOTO UPDATE
GOTO START

:UPDATE
RTTR\s25update.exe --dir %CD%
RTTR\s25update.exe --dir %CD% @STABLE_PARAM@

:START
s25client.exe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [ $noupdate -eq 0 ] ; then
echo "checking for an update ..."
cp $DIR/../libexec/s25rttr/s25update /tmp/s25update.$$
chmod 0755 /tmp/s25update.$$
/tmp/s25update.$$ --verbose --dir "$DIR/../"
/tmp/s25update.$$ --verbose --dir "$DIR/../" @STABLE_PARAM@
if [ -z "$(diff -q /tmp/s25update.$$ $DIR/../libexec/s25rttr/s25update)" ] ; then
PARAM=noupdate
fi
Expand Down

0 comments on commit 7273dd8

Please sign in to comment.