[Cmake-commits] CMake branch, next, updated. v3.5.1-704-g77220f1
Domen Vrankar
domen.vrankar at gmail.com
Thu Mar 31 01:49:16 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 77220f1ad6bf349e51f83d251c2a3a738b2c772a (commit)
via 44eb6c235df7344b60bd85062604b187c9754d07 (commit)
via b290ddf925aee7dca25396035b1b53223d37e9e5 (commit)
via 00e4d1220bb9f3c43bd3d339b0114d2074480bd7 (commit)
from 24d322015972bac129ee752fb45edc485fb17a45 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77220f1ad6bf349e51f83d251c2a3a738b2c772a
commit 77220f1ad6bf349e51f83d251c2a3a738b2c772a
Merge: 24d3220 44eb6c2
Author: Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Thu Mar 31 01:49:14 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Mar 31 01:49:14 2016 -0400
Merge topic 'cpack-rpm-external-symlink-handling' into next
44eb6c23 CPack/RPM external symlink handling
b290ddf9 CMake Nightly Date Stamp
00e4d122 CMake Nightly Date Stamp
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44eb6c235df7344b60bd85062604b187c9754d07
commit 44eb6c235df7344b60bd85062604b187c9754d07
Author: Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Thu Mar 31 07:48:38 2016 +0200
Commit: Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Thu Mar 31 07:48:38 2016 +0200
CPack/RPM external symlink handling
Symbolic links that point to external
location no longer cause cmake to fail
with string out of bounds error but
are instead packaged as non relocatable
symlinks and print out a warning message.
diff --git a/Help/release/dev/cpack-rpm-external-symlink-handling.rst b/Help/release/dev/cpack-rpm-external-symlink-handling.rst
new file mode 100644
index 0000000..d9a3d8c
--- /dev/null
+++ b/Help/release/dev/cpack-rpm-external-symlink-handling.rst
@@ -0,0 +1,5 @@
+cpack-rpm-external-symlink-handling
+--------------------------------
+
+* The "CPackRPM" module learned how to correctly handle symlinks
+ that are pointing outside generated packages.
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index ae51dc1..5c51fac 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -599,9 +599,10 @@
# while determining if symlink should be either created or present in a
# post install script - depending on relocation paths.
#
-# Currenty there are a few limitations though:
+# Symbolic links that point to locations outside packaging path produce a
+# warning and are treated as non relocatable permanent symbolic links.
#
-# * Only symbolic links with relative path can be packaged.
+# Currenty there are a few limitations though:
#
# * For component based packaging component interdependency is not checked
# when processing symbolic links. Symbolic links pointing to content of
@@ -1068,13 +1069,28 @@ function(cpack_rpm_prepare_install_files INSTALL_FILES_LIST WDIR PACKAGE_PREFIXE
get_filename_component(SYMLINK_POINT_ "${SYMLINK_LOCATION_}/${SYMLINK_POINT_}" ABSOLUTE)
endif()
- string(SUBSTRING "${SYMLINK_POINT_}" ${WDR_LEN_} -1 SYMLINK_POINT_WD_)
+ # recalculate path length after conversion to canonical form
+ string(LENGTH "${SYMLINK_POINT_}" SYMLINK_POINT_LENGTH_)
- cpack_rpm_symlink_get_relocation_prefixes("${F}" "${PACKAGE_PREFIXES}" "SYMLINK_RELOCATIONS")
- cpack_rpm_symlink_get_relocation_prefixes("${SYMLINK_POINT_WD_}" "${PACKAGE_PREFIXES}" "POINT_RELOCATIONS")
+ if(SYMLINK_POINT_ MATCHES "${WDIR}/.*")
+ # only symlinks that are pointing inside the packaging structure should be checked for relocation
+ string(SUBSTRING "${SYMLINK_POINT_}" ${WDR_LEN_} -1 SYMLINK_POINT_WD_)
+ cpack_rpm_symlink_get_relocation_prefixes("${F}" "${PACKAGE_PREFIXES}" "SYMLINK_RELOCATIONS")
+ cpack_rpm_symlink_get_relocation_prefixes("${SYMLINK_POINT_WD_}" "${PACKAGE_PREFIXES}" "POINT_RELOCATIONS")
- list(LENGTH SYMLINK_RELOCATIONS SYMLINK_RELOCATIONS_COUNT)
- list(LENGTH POINT_RELOCATIONS POINT_RELOCATIONS_COUNT)
+ list(LENGTH SYMLINK_RELOCATIONS SYMLINK_RELOCATIONS_COUNT)
+ list(LENGTH POINT_RELOCATIONS POINT_RELOCATIONS_COUNT)
+ else()
+ # location pointed to is ouside WDR so it should be treated as a permanent symlink
+ set(SYMLINK_POINT_WD_ "${SYMLINK_POINT_}")
+
+ unset(SYMLINK_RELOCATIONS)
+ unset(POINT_RELOCATIONS)
+ unset(SYMLINK_RELOCATIONS_COUNT)
+ unset(POINT_RELOCATIONS_COUNT)
+
+ message(WARNING "Symbolic link '${F}' points to location that is outside packaging path! Link will not be relocatable.")
+ endif()
if(SYMLINK_RELOCATIONS_COUNT AND POINT_RELOCATIONS_COUNT)
# find matching
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 823f6db..05c13a4 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -92,6 +92,9 @@ if("${CPACK_GENERATOR}" MATCHES "RPM")
# test symbolic link to location outside package
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ./outside_package symlink_outside_package)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_outside_package DESTINATION ${CMAKE_INSTALL_LIBDIR}/inside_relocatable_one/depth_two COMPONENT libraries)
+ # test symbolic link to location outside wdr (packaging directory)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink /outside_package_wdr symlink_outside_wdr)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/symlink_outside_wdr DESTINATION ${CMAKE_INSTALL_LIBDIR}/inside_relocatable_one/depth_two COMPONENT libraries)
endif()
# CPack boilerplate for this project
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 0c5cca8..e956f17 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -188,6 +188,7 @@ if(CPackGen MATCHES "RPM")
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/depth_three
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/depth_three/symlink_parentdir_path
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/symlink_outside_package
+/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/symlink_outside_wdr
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/symlink_relocatable_subpath
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/symlink_samedir_path
/usr/foo/bar/lib${LIB_SUFFIX}/inside_relocatable_one/depth_two/symlink_samedir_path_current_dir
@@ -354,6 +355,8 @@ if(CPackGen MATCHES "RPM")
string(REGEX MATCH "^.*${whitespaces}->${whitespaces}${CPACK_PACKAGING_INSTALL_PREFIX}/non_relocatable/depth_two$" check_symlink "${SYMLINK_POINT_}")
elseif("${symlink_name}" STREQUAL "symlink_outside_package")
string(REGEX MATCH "^.*${whitespaces}->${whitespaces}outside_package$" check_symlink "${SYMLINK_POINT_}")
+ elseif("${symlink_name}" STREQUAL "symlink_outside_wdr")
+ string(REGEX MATCH "^.*${whitespaces}->${whitespaces}/outside_package_wdr$" check_symlink "${SYMLINK_POINT_}")
elseif("${symlink_name}" STREQUAL "symlink_other_relocatable_path"
OR "${symlink_name}" STREQUAL "symlink_from_non_relocatable_path"
OR "${symlink_name}" STREQUAL "symlink_relocatable_subpath")
-----------------------------------------------------------------------
Summary of changes:
.../dev/cpack-rpm-external-symlink-handling.rst | 5 ++++
Modules/CPackRPM.cmake | 30 +++++++++++++++-----
Source/CMakeVersion.cmake | 2 +-
Tests/CPackComponentsForAll/CMakeLists.txt | 3 ++
.../RunCPackVerifyResult.cmake | 3 ++
5 files changed, 35 insertions(+), 8 deletions(-)
create mode 100644 Help/release/dev/cpack-rpm-external-symlink-handling.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list