From b2f2590e6c566d1ed4df87cf52279106497d584d Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 29 Sep 2010 10:11:24 -0500 Subject: Add Summary/Description support to packaging [BUGID #281] Add the ability for the deb, ipk and rpm classes to use the new summary and description fields. The Description is wrapped around 75 characters to ensure a reasonably nice, presentable description. (Summary defaults to the description if Summary is not defined.) Signed-off-by: Mark Hatle --- meta/classes/package_ipk.bbclass | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'meta/classes/package_ipk.bbclass') diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 1758283f61..cac0453685 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -135,6 +135,7 @@ package_generate_archlist () { python do_package_ipk () { import re, copy + import textwrap workdir = bb.data.getVar('WORKDIR', d, True) outdir = bb.data.getVar('PKGWRITEDIRIPK', d, True) @@ -227,7 +228,15 @@ python do_package_ipk () { for f in fs: if bb.data.getVar(f, localdata) is None: raise KeyError(f) - ctrlfile.write(c % tuple(pullData(fs, localdata))) + # Special behavior for description... + if 'DESCRIPTION' in fs: + summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "." + description = bb.data.getVar('DESCRIPTION', localdata, True) or "." + description = textwrap.dedent(description).strip() + ctrlfile.write('Description: %s\n' % summary) + ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) + else: + ctrlfile.write(c % tuple(pullData(fs, localdata))) except KeyError: import sys (type, value, traceback) = sys.exc_info() -- cgit v1.2.3-54-g00ecf