The recipe's DESCRIPTION is wrapped automatically by textwrap, make it support newline ("\n") to let the user can wrap it manually, e.g.:
DESCRIPTION = "Foo1\nFoo2" In the past, it would be: Foo1\nFoo2 Now: Foo1 Foo2 [YOCTO #4348] Signed-off-by: Robert Yang <liezhi.y...@windriver.com> --- meta/classes/package_rpm.bbclass | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index c654cdb..01bfaf1 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -534,7 +534,6 @@ def write_rpm_perfiledata(srcname, d): python write_specfile () { - import textwrap import oe.packagedata # append information for logs and patches to %prep @@ -668,6 +667,18 @@ python write_specfile () { deps.append(depends) return " ".join(deps) + def append_description(spec_preamble, text): + """ + Add the description to the spec file, respect to the rules: + - split the DESCRIPTION into multi-lines by newline (\n), and + - the text width is 75. + """ + import textwrap + dedent_text = textwrap.dedent(text).strip() + # Bitbake saves "\n" as "\\n" + for t in dedent_text.split('\\n'): + spec_preamble.append('%s' % textwrap.fill(t.strip(), width=75)) + packages = d.getVar('PACKAGES', True) if not packages or packages == '': bb.debug(1, "No packages; nothing to do") @@ -868,8 +879,7 @@ python write_specfile () { spec_preamble_bottom.append('') spec_preamble_bottom.append('%%description -n %s' % splitname) - dedent_text = textwrap.dedent(splitdescription).strip() - spec_preamble_bottom.append('%s' % textwrap.fill(dedent_text, width=75)) + append_description(spec_preamble_bottom, splitdescription) spec_preamble_bottom.append('') @@ -975,8 +985,7 @@ python write_specfile () { spec_preamble_top.append('') spec_preamble_top.append('%description') - dedent_text = textwrap.dedent(srcdescription).strip() - spec_preamble_top.append('%s' % textwrap.fill(dedent_text, width=75)) + append_description(spec_preamble_top, srcdescription) spec_preamble_top.append('') -- 1.7.10.4 _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core