summaryrefslogtreecommitdiff
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2013-06-19 01:25:38 -0400
committerSaul Wold <sgw@linux.intel.com>2013-07-09 08:04:09 -0700
commit503b6370080fcbcd99305eac846c6dfbdd07c5df (patch)
tree1a1cb5ddc41e57601121c38549957022ad81aa91 /meta/classes/package_rpm.bbclass
parentc7b10e33365f0c445d0aa1a6aad8e612cdc391e1 (diff)
downloadopenembedded-core-503b6370080fcbcd99305eac846c6dfbdd07c5df.tar.gz
openembedded-core-503b6370080fcbcd99305eac846c6dfbdd07c5df.tar.bz2
openembedded-core-503b6370080fcbcd99305eac846c6dfbdd07c5df.zip
package_rpm.bbclass: make DESCRIPTION support newline
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.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass20
1 files changed, 15 insertions, 5 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index c654cdb5e8..fa928ce042 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,19 @@ python write_specfile () {
deps.append(depends)
return " ".join(deps)
+ def append_description(spec_preamble, text):
+ """
+ Add the description to the spec file.
+ """
+ import textwrap
+ dedent_text = textwrap.dedent(text).strip()
+ # Bitbake saves "\n" as "\\n"
+ if '\\n' in dedent_text:
+ for t in dedent_text.split('\\n'):
+ spec_preamble.append(t.strip())
+ else:
+ spec_preamble.append('%s' % textwrap.fill(dedent_text, width=75))
+
packages = d.getVar('PACKAGES', True)
if not packages or packages == '':
bb.debug(1, "No packages; nothing to do")
@@ -868,8 +880,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 +986,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('')