VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2025-01-11 16:23:11 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2025-01-11 16:23:11 +0100
commitcc2f177c5c8c2f7b1e71afa7668f186b1f6a381e (patch)
tree7365f46ddd5a47b48429079b73e2ea5d511a3534
parente8e0be2ad55fbcb88228c5e8e7e65922458e3a49 (diff)
downloadVeraCrypt-cc2f177c5c8c2f7b1e71afa7668f186b1f6a381e.tar.gz
VeraCrypt-cc2f177c5c8c2f7b1e71afa7668f186b1f6a381e.zip
Linux Debian/Ubuntu: use a distro-specific version string to avoid APT repository conflictsHEADmaster
In a Debian-style APT repository, the pool/ directory groups packages primarily by source package name and binary package name, version, architecture, etc. If two distinct .deb files have identical name and version (as seen in their control file) and same architecture, reprepro will report a conflict when adding one after the other. So, we need to append distro-specific string to the existing version in order to avoid such conflict when creating VeraCrypt APT repository.
-rw-r--r--src/Build/CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt
index b8a7c8ad..a456c911 100644
--- a/src/Build/CMakeLists.txt
+++ b/src/Build/CMakeLists.txt
@@ -252,7 +252,19 @@ if ( ( PLATFORM STREQUAL "Debian" ) OR ( PLATFORM STREQUAL "Ubuntu" ) )
set( CPACK_GENERATOR "DEB" ) # mandatory
set( CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME} ) # mandatory
set( CPACK_DEBIAN_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}.deb ) # mandatory
- set( CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION} ) # mandatory
+ # -- Use a distro-specific version string to avoid repository conflicts --
+ # e.g. 1.26.17-1~deb11, 1.26.17-1~deb12, 1.26.17-1~ubuntu20.04, etc.
+ if (PLATFORM STREQUAL "Ubuntu")
+ # For something like "24.04", it becomes 1.26.17-1~ubuntu24.04
+ set(CPACK_DEBIAN_PACKAGE_VERSION
+ "${VERSION}-${RELEASE}~ubuntu${PLATFORM_VERSION}")
+ else() # Debian
+ # Usually just take the major number from e.g. "11.7" => "11"
+ string(REGEX MATCH "^[0-9]+" PLATFORM_VERSION_MAJOR "${PLATFORM_VERSION}")
+ set(CPACK_DEBIAN_PACKAGE_VERSION
+ "${VERSION}-${RELEASE}~deb${PLATFORM_VERSION_MAJOR}")
+ endif()
+
set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} )
set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCHITECTURE} ) # mandatory