File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
RunCMake/CPack/tests/DEB_DESCRIPTION Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,16 @@ function(cpack_deb_format_package_description TEXT OUTPUT_VAR)
83
83
string (REPLACE "\n " ";" _lines "${_text} " )
84
84
list (POP_FRONT _lines _summary )
85
85
86
+ # If the description ends with a newline (e.g. typically if it was read
87
+ # from a file) the last line will be empty. We drop it here, otherwise
88
+ # it would be replaced by a `.` which would lead to the package violating
89
+ # the extended-description-contains-empty-paragraph debian policy
90
+ list (POP_BACK _lines _last_line )
91
+ string (STRIP "${_last_line} " _last_line_strip )
92
+ if (_last_line_strip )
93
+ list (APPEND _lines "${_last_line_strip} " )
94
+ endif ()
95
+
86
96
# Check if reformatting required
87
97
cpack_deb_check_description ("${_summary} " "${_lines} " _result )
88
98
if (_result )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
16
16
17
17
# overriding previous descriptions
18
18
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "main description" ) # This become a summary line (the first one) of all descriptions
19
- set (CPACK_COMPONENT_APPLICATIONS_DESCRIPTION "applications_description" )
19
+ set (CPACK_COMPONENT_APPLICATIONS_DESCRIPTION "applications_description\n " )
20
20
set (CPACK_COMPONENT_HEADERS_DESCRIPTION "headers_description" )
21
21
# libraries does not have any description and should inherit from CPACK_PACKAGE_DESCRIPTION_SUMMARY
22
22
# plus content of the `CPACK_PACKAGE_DESCRIPTION_FILE`.
Original file line number Diff line number Diff line change @@ -46,17 +46,7 @@ set(_expected_description [[ Description: This is the summary line
46
46
.
47
47
See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description]] )
48
48
49
- # ATTENTION The code in `cmCPackGenerator.cxx` to read `CPACK_PACKAGE_DESCRIPTION_FILE`
50
- # has a BUG: it appends the `\n` character to every line of the
51
- # input, even if there was no EOL (e.g. at the last line of the file).
52
- # That is WHY for this sub-test the one more pre-formatted "empty"
53
- # line required!
54
- # NOTE For component based installers content of the file gonna read by
55
- # `CPackDeb` module and the `file(READ...)` command so no the mentioned
56
- # workaround required!
57
- if (RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE" AND PACKAGING_TYPE STREQUAL "MONOLITHIC" )
58
- string (APPEND _expected_description "\n ." )
59
- elseif (RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_NO_PACKAGE_DESCRIPTION" )
49
+ if (RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_NO_PACKAGE_DESCRIPTION" )
60
50
set (_expected_description [[ Description: This is the summary line]] )
61
51
elseif (RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_COMPONENT_COMP_DESCRIPTION" )
62
52
set (_expected_description [[ Description: One line description]] )
You can’t perform that action at this time.
0 commit comments