CPack/RPM debuginfo package without binaries

Handle case when a component doesn't contain
any debuginfo symbols.
This commit is contained in:
Domen Vrankar 2016-10-06 08:04:58 +02:00 committed by Brad King
parent ca50c89e41
commit f53b01ff0f
1 changed files with 38 additions and 27 deletions

View File

@ -1477,16 +1477,22 @@ function(cpack_rpm_debugsymbol_check INSTALL_FILES WORKING_DIR)
endif() endif()
endforeach() endforeach()
list(REMOVE_DUPLICATES mkdir_list_) list(LENGTH mkdir_list_ len_)
unset(TMP_RPM_DEBUGINFO_INSTALL) if(len_)
foreach(part_ IN LISTS mkdir_list_) list(REMOVE_DUPLICATES mkdir_list_)
string(APPEND TMP_RPM_DEBUGINFO_INSTALL "mkdir -p \"${part_}\"\n") unset(TMP_RPM_DEBUGINFO_INSTALL)
endforeach() foreach(part_ IN LISTS mkdir_list_)
string(APPEND TMP_RPM_DEBUGINFO_INSTALL "mkdir -p \"${part_}\"\n")
endforeach()
endif()
list(REMOVE_DUPLICATES cp_list_) list(LENGTH cp_list_ len_)
foreach(part_ IN LISTS cp_list_) if(len_)
string(APPEND TMP_RPM_DEBUGINFO_INSTALL "${part_}\n") list(REMOVE_DUPLICATES cp_list_)
endforeach() foreach(part_ IN LISTS cp_list_)
string(APPEND TMP_RPM_DEBUGINFO_INSTALL "${part_}\n")
endforeach()
endif()
if(NOT DEFINED CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS) if(NOT DEFINED CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS)
set(CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS /usr /usr/src /usr/src/debug) set(CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS /usr /usr/src /usr/src/debug)
@ -1501,29 +1507,34 @@ function(cpack_rpm_debugsymbol_check INSTALL_FILES WORKING_DIR)
message("CPackRPM:Debug: CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS= ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS}") message("CPackRPM:Debug: CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS= ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS}")
endif() endif()
list(REMOVE_DUPLICATES additional_sources_) list(LENGTH additional_sources_ len_)
unset(additional_sources_all_) if(len_)
foreach(source_ IN LISTS additional_sources_) list(REMOVE_DUPLICATES additional_sources_)
string(REPLACE "/" ";" split_source_ " ${source_}") unset(additional_sources_all_)
list(REMOVE_AT split_source_ 0) foreach(source_ IN LISTS additional_sources_)
unset(tmp_path_) string(REPLACE "/" ";" split_source_ " ${source_}")
# Now generate all segments of the path list(REMOVE_AT split_source_ 0)
foreach(segment_ IN LISTS split_source_) unset(tmp_path_)
string(APPEND tmp_path_ "/${segment_}") # Now generate all segments of the path
list(APPEND additional_sources_all_ "${tmp_path_}") foreach(segment_ IN LISTS split_source_)
string(APPEND tmp_path_ "/${segment_}")
list(APPEND additional_sources_all_ "${tmp_path_}")
endforeach()
endforeach() endforeach()
endforeach()
list(REMOVE_DUPLICATES additional_sources_all_) list(REMOVE_DUPLICATES additional_sources_all_)
list(REMOVE_ITEM additional_sources_all_ ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS}) list(REMOVE_ITEM additional_sources_all_
${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS})
unset(TMP_DEBUGINFO_ADDITIONAL_SOURCES) unset(TMP_DEBUGINFO_ADDITIONAL_SOURCES)
foreach(source_ IN LISTS additional_sources_all_) foreach(source_ IN LISTS additional_sources_all_)
string(APPEND TMP_DEBUGINFO_ADDITIONAL_SOURCES "${source_}\n") string(APPEND TMP_DEBUGINFO_ADDITIONAL_SOURCES "${source_}\n")
endforeach() endforeach()
endif()
set(TMP_RPM_DEBUGINFO_INSTALL "${TMP_RPM_DEBUGINFO_INSTALL}" PARENT_SCOPE) set(TMP_RPM_DEBUGINFO_INSTALL "${TMP_RPM_DEBUGINFO_INSTALL}" PARENT_SCOPE)
set(TMP_DEBUGINFO_ADDITIONAL_SOURCES "${TMP_DEBUGINFO_ADDITIONAL_SOURCES}" PARENT_SCOPE) set(TMP_DEBUGINFO_ADDITIONAL_SOURCES "${TMP_DEBUGINFO_ADDITIONAL_SOURCES}"
PARENT_SCOPE)
endfunction() endfunction()
function(cpack_rpm_variable_fallback OUTPUT_VAR_NAME) function(cpack_rpm_variable_fallback OUTPUT_VAR_NAME)