Avoid storing non-reproducible information
authorStephen Kitt <skitt@debian.org>
Mon, 16 Mar 2020 22:08:22 +0000 (22:08 +0000)
committerStephen Kitt <skitt@debian.org>
Mon, 16 Mar 2020 22:08:22 +0000 (22:08 +0000)
This drops git information as well as the build architecture (from the
user agent). The former varies depending on the availability of git
tools, the latter varies depending on the build host.

Gbp-Pq: Name reproducible.patch

CMakeLists.txt

index fbfbcacfef0eb6a74a45f60e65baa1a7bfc289f1..64e2d1c4fbe3f63f348eaac0283a9ead9beb6a26 100644 (file)
@@ -71,46 +71,9 @@ if(USE_QT_GUI)
 endif(USE_QT_GUI)
 
 
-set(GIT_CHECKOUT FALSE)
-if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
-  if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
-    find_package(Git)
-    if(GIT_FOUND)
-      set(GIT_CHECKOUT TRUE)
-    else(GIT_FOUND)
-      message(WARNING "Git executable not found")
-    endif(GIT_FOUND)
-  else(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
-    message(STATUS "Shallow Git clone detected, not attempting to retrieve version info")
-  endif(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
-endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
-
-if(GIT_CHECKOUT)
-  execute_process(COMMAND ${GIT_EXECUTABLE} diff --shortstat
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    OUTPUT_VARIABLE GIT_SHORTSTAT
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-  )
-  execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    OUTPUT_VARIABLE GIT_REV_PARSE
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-  )
-  if(GIT_SHORTSTAT)
-    set(GIT_DIRTY ON)
-  endif(GIT_SHORTSTAT)
-
-  if(GIT_DIRTY)
-    set(PROJECT_VERSION_MINOR ${PROJECT_VERSION_MINOR}M)
-  endif(GIT_DIRTY)
-
-  set(PROJECT_VERSION_PATCH ${GIT_REV_PARSE})
-  set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
-endif(GIT_CHECKOUT)
-
 set(VERSION_NUMBER ${PROJECT_VERSION})
 set(VERSION_STRING "LGOGDownloader ${VERSION_NUMBER}")
-set(DEFAULT_USER_AGENT "LGOGDownloader/${VERSION_NUMBER} (${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR})")
+set(DEFAULT_USER_AGENT "LGOGDownloader/${VERSION_NUMBER}")
 
 add_definitions(-D_FILE_OFFSET_BITS=64 -DVERSION_NUMBER="${VERSION_NUMBER}" -DVERSION_STRING="${VERSION_STRING}" -DDEFAULT_USER_AGENT="${DEFAULT_USER_AGENT}")