mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
5783e717ee
commit
b2f2590e6c
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user