diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2010-09-29 10:11:24 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-11 22:13:14 +0100 |
commit | b2f2590e6c566d1ed4df87cf52279106497d584d (patch) | |
tree | 3e0b27e130a0f878f87b8843e9486411925e5a96 /meta/classes/package_deb.bbclass | |
parent | 5783e717ee9f503d8e03992306a6b9ddfda6f73e (diff) | |
download | openembedded-core-b2f2590e6c566d1ed4df87cf52279106497d584d.tar.gz openembedded-core-b2f2590e6c566d1ed4df87cf52279106497d584d.tar.bz2 openembedded-core-b2f2590e6c566d1ed4df87cf52279106497d584d.tar.xz openembedded-core-b2f2590e6c566d1ed4df87cf52279106497d584d.zip |
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 <mark.hatle@windriver.com>
Diffstat (limited to 'meta/classes/package_deb.bbclass')
-rw-r--r-- | meta/classes/package_deb.bbclass | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index eb4df5e70..8a9cdc071 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass @@ -69,6 +69,7 @@ python do_package_deb_install () { python do_package_deb () { import re, copy + import textwrap workdir = bb.data.getVar('WORKDIR', d, True) if not workdir: @@ -179,7 +180,18 @@ python do_package_deb () { # check for required fields try: for (c, fs) in fields: - ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) + for f in fs: + if bb.data.getVar(f, localdata) is None: + raise KeyError(f) + # 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' % unicode(summary)) + ctrlfile.write('%s\n' % unicode(textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))) + else: + ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) except KeyError: import sys (type, value, traceback) = sys.exc_info() |