CPack/RPM honor package file name on debuginfo enabled

Packages with debuginfo enabled should
still honor defined package file name
if file name is not set to RPM-DEFAULT.

Fixes #16715
This commit is contained in:
Domen Vrankar 2017-03-23 23:36:47 +01:00
parent f0f60c548a
commit 6c09c5d64c
3 changed files with 12 additions and 4 deletions

View File

@ -2648,8 +2648,8 @@ mv %_topdir/tmpBBroot $RPM_BUILD_ROOT
unset(expected_filenames_)
unset(filenames_)
if(CPACK_RPM_DEBUGINFO_PACKAGE AND NOT CPACK_RPM_FILE_NAME STREQUAL "RPM-DEFAULT")
string(TOLOWER "${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.*\\.rpm" efn_)
list(APPEND expected_filenames_ "${efn_}")
list(APPEND expected_filenames_
"${CPACK_RPM_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.*\\.rpm")
list(APPEND filenames_ "${CPACK_RPM_FILE_NAME}")
endif()

View File

@ -3,14 +3,17 @@ set(whitespaces_ "[\t\n\r ]*")
set(EXPECTED_FILES_COUNT "5")
set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
set(EXPECTED_FILE_1_NAME "Debuginfo")
set(EXPECTED_FILE_1_COMPONENT "applications")
set(EXPECTED_FILE_CONTENT_1_LIST "/usr;/usr/foo;/usr/foo/test_prog")
set(EXPECTED_FILE_2 "debuginfo*-headers.rpm")
set(EXPECTED_FILE_2 "TestDinfo-pkg*-headers.rpm")
set(EXPECTED_FILE_CONTENT_2_LIST "/usr;/usr/bar;/usr/bar/CMakeLists.txt")
set(EXPECTED_FILE_3 "debuginfo*-libs.rpm")
set(EXPECTED_FILE_3 "TestDinfo-pkg*-libs.rpm")
set(EXPECTED_FILE_CONTENT_3_LIST "/usr;/usr/bas;/usr/bas/libtest_lib.so")
set(EXPECTED_FILE_4_NAME "Debuginfo")
set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo")
set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*")
set(EXPECTED_FILE_5_NAME "Debuginfo")
set(EXPECTED_FILE_5_COMPONENT "libs-debuginfo")
set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*")

View File

@ -25,6 +25,11 @@ install(TARGETS test_lib DESTINATION bas COMPONENT libs)
set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON)
# test that components with debuginfo enabled still honor
# CPACK_PACKAGE_FILE_NAME setting
set(CPACK_RPM_PACKAGE_NAME "Debuginfo")
set(CPACK_PACKAGE_FILE_NAME "TestDinfo-pkg")
set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON)
set(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/src")