CPackRPM: Drop explicit handling of '@' symbols that breaks them (#14782)
The change in commit v2.8.12~218^2 (CPackRPM protect '@' character in filename processed in the spec file, 2013-07-05) was not necessary after commit v2.8.12~439^2 (Add support for componentized USER spec file, 2013-04-01). The latter replaced ${VAR} references in the spec file template string with \@VAR\@ references, thus protecting '@' symbols automatically. This caused CPackRPM to break paths with @ symbols. Revert the change to fix the behavior, and add a test case.
This commit is contained in:
parent
cb16c7844d
commit
5857ca5e0d
|
@ -1175,13 +1175,6 @@ if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# protect @ in pathname in order to avoid their
|
|
||||||
# interpretation during the configure_file step
|
|
||||||
set(CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES}")
|
|
||||||
set(PROTECTED_AT "@")
|
|
||||||
string(REPLACE "@" "\@PROTECTED_AT\@" CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES_LIST}")
|
|
||||||
set(CPACK_RPM_INSTALL_FILES_LIST "")
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# USER generated/provided spec file handling.
|
# USER generated/provided spec file handling.
|
||||||
#
|
#
|
||||||
|
@ -1292,9 +1285,6 @@ else()
|
||||||
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# remove AT protection
|
|
||||||
unset(PROTECTED_AT)
|
|
||||||
|
|
||||||
if(RPMBUILD_EXECUTABLE)
|
if(RPMBUILD_EXECUTABLE)
|
||||||
# Now call rpmbuild using the SPECFILE
|
# Now call rpmbuild using the SPECFILE
|
||||||
execute_process(
|
execute_process(
|
||||||
|
|
|
@ -43,7 +43,7 @@ install(TARGETS mylibapp
|
||||||
# CPACK_MONOLITHIC_INSTALL=1 is set (at cmake time).
|
# CPACK_MONOLITHIC_INSTALL=1 is set (at cmake time).
|
||||||
install(TARGETS mylibapp2
|
install(TARGETS mylibapp2
|
||||||
RUNTIME
|
RUNTIME
|
||||||
DESTINATION bin)
|
DESTINATION bin/@in@_@path@@with\\@and\\@/\@in_path\@) # test @ char in path
|
||||||
|
|
||||||
install(FILES mylib.h
|
install(FILES mylib.h
|
||||||
DESTINATION include
|
DESTINATION include
|
||||||
|
|
|
@ -139,6 +139,7 @@ if(CPackGen MATCHES "RPM")
|
||||||
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
|
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
|
||||||
"C/C\\+\\+ header files for use with MyLib")
|
"C/C\\+\\+ header files for use with MyLib")
|
||||||
|
|
||||||
|
# test package info
|
||||||
if(${CPackComponentWay} STREQUAL "IgnoreGroup")
|
if(${CPackComponentWay} STREQUAL "IgnoreGroup")
|
||||||
# set gnu install prefixes to what they are set during rpm creation
|
# set gnu install prefixes to what they are set during rpm creation
|
||||||
# CMAKE_SIZEOF_VOID_P is not set here but lib is prefix of lib64 so
|
# CMAKE_SIZEOF_VOID_P is not set here but lib is prefix of lib64 so
|
||||||
|
@ -213,6 +214,29 @@ if(CPackGen MATCHES "RPM")
|
||||||
message(FATAL_ERROR "error: '${check_file}' Architecture does not match expected value - '${check_file_match_expected_architecture}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
|
message(FATAL_ERROR "error: '${check_file}' Architecture does not match expected value - '${check_file_match_expected_architecture}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
elseif(${CPackComponentWay} STREQUAL "IgnoreGroup")
|
|
||||||
|
# test package content
|
||||||
|
foreach(check_file ${expected_file})
|
||||||
|
string(REGEX MATCH ".*Unspecified.*" check_file_Unspecified_match ${check_file})
|
||||||
|
|
||||||
|
if(check_file_Unspecified_match)
|
||||||
|
execute_process(COMMAND ${RPM_EXECUTABLE} -pql ${check_file}
|
||||||
|
OUTPUT_VARIABLE check_file_content
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
string(REGEX MATCH ".*bin/@in@_@path@@with/@and/@/@in_path@/mylibapp2$" check_at_in_path ${check_file_content})
|
||||||
|
|
||||||
|
if(NOT check_at_in_path)
|
||||||
|
file(GLOB_RECURSE spec_file "${CPackComponentsForAll_BINARY_DIR}/*Unspecified*.spec")
|
||||||
|
|
||||||
|
if(spec_file)
|
||||||
|
file(READ ${spec_file} spec_file_content)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(FATAL_ERROR "error: '${check_file}' rpm package path with @ characters is missing or invalid. RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue