summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_deb.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-09-29 10:11:24 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-11 22:13:14 +0100
commitb2f2590e6c566d1ed4df87cf52279106497d584d (patch)
tree3e0b27e130a0f878f87b8843e9486411925e5a96 /meta/classes/package_deb.bbclass
parent5783e717ee9f503d8e03992306a6b9ddfda6f73e (diff)
downloadpoky-b2f2590e6c566d1ed4df87cf52279106497d584d.tar.gz
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.bbclass14
1 files changed, 13 insertions, 1 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index eb4df5e704..8a9cdc071d 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -69,6 +69,7 @@ python do_package_deb_install () {
69 69
70python do_package_deb () { 70python do_package_deb () {
71 import re, copy 71 import re, copy
72 import textwrap
72 73
73 workdir = bb.data.getVar('WORKDIR', d, True) 74 workdir = bb.data.getVar('WORKDIR', d, True)
74 if not workdir: 75 if not workdir:
@@ -179,7 +180,18 @@ python do_package_deb () {
179 # check for required fields 180 # check for required fields
180 try: 181 try:
181 for (c, fs) in fields: 182 for (c, fs) in fields:
182 ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) 183 for f in fs:
184 if bb.data.getVar(f, localdata) is None:
185 raise KeyError(f)
186 # Special behavior for description...
187 if 'DESCRIPTION' in fs:
188 summary = bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or "."
189 description = bb.data.getVar('DESCRIPTION', localdata, True) or "."
190 description = textwrap.dedent(description).strip()
191 ctrlfile.write('Description: %s\n' % unicode(summary))
192 ctrlfile.write('%s\n' % unicode(textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')))
193 else:
194 ctrlfile.write(unicode(c % tuple(pullData(fs, localdata))))
183 except KeyError: 195 except KeyError:
184 import sys 196 import sys
185 (type, value, traceback) = sys.exc_info() 197 (type, value, traceback) = sys.exc_info()