From: Phil Blundell <pb@pbcl.net>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/3] package_ipk.bbclass: make DESCRIPTION support newline
Date: Wed, 19 Jun 2013 11:10:03 +0100 [thread overview]
Message-ID: <1371636603.6580.79.camel@phil-desktop.brightsign> (raw)
In-Reply-To: <20130619092952.GF14021@jama>
On Wed, 2013-06-19 at 11:29 +0200, Martin Jansa wrote:
> On Wed, Jun 19, 2013 at 05:00:40AM -0400, Robert Yang wrote:
> > 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>
> > ---
> > meta/classes/package_ipk.bbclass | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
> > index 55628e4..e67f641 100644
> > --- a/meta/classes/package_ipk.bbclass
> > +++ b/meta/classes/package_ipk.bbclass
> > @@ -304,10 +304,11 @@ python do_package_ipk () {
> > # Special behavior for description...
> > if 'DESCRIPTION' in fs:
> > summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
> > + ctrlfile.write('Description: %s\n' % summary)
> > description = localdata.getVar('DESCRIPTION', 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=' '))
> > + for t in description.split('\\n'):
> > + ctrlfile.write('%s\n' % textwrap.fill(t, width=74, initial_indent=' ', subsequent_indent=' '))
> > else:
>
> Isn't DESCRIPTION supposed to be short oneline and longer multiline only
> in SUMMARY?
No, the reverse. SUMMARY is (as the name suggests, and as the existing
code implements) meant to be the short synopsis and DESCRIPTION is the
longer text.
> is opkg-utils (package-index) working with this? Newlines in SUMMARY
> were causing incorrect parsing and not using cache IIRC, not sure if the
> fix for that was generic enough to cover DESCRIPTION.
Newlines in SUMMARY would indeed break opkg-utils because the text after
the line break wouldn't be correctly indented. It wouldn't be a bad
thing for package_ipk to check for that, but this shouldn't be an issue
with the patch above since it seems to be explicitly indenting all lines
of the long description.
I'm not entirely thrilled with Robert's patch because it seems rather
ugly to have embedded "\n" sequences in the recipe DESCRIPTION fields,
and also because package_ipk isn't the only consumer of that variable
and it isn't entirely obvious that all the other users will know what to
do. But, absent a way to express string literals with embedded newlines
in bitbake, perhaps this is indeed the best compromise.
p.
next prev parent reply other threads:[~2013-06-19 10:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 9:00 [PATCH 0/3] make DESCRIPTION support newline Robert Yang
2013-06-19 9:00 ` [PATCH 1/3] package_rpm.bbclass: " Robert Yang
2013-06-19 9:00 ` [PATCH 2/3] package_ipk.bbclass: " Robert Yang
2013-06-19 9:29 ` Martin Jansa
2013-06-19 9:49 ` Richard Purdie
2013-06-19 10:10 ` Phil Blundell [this message]
2013-06-19 10:33 ` Enrico Scholz
2013-06-28 3:21 ` Robert Yang
2013-06-19 9:00 ` [PATCH 3/3] package_deb.bbclass: " Robert Yang
2013-06-26 3:27 ` [PATCH 0/3] " Robert Yang
2013-06-26 16:05 ` Saul Wold
2013-06-28 2:04 ` Robert Yang
2013-06-28 6:50 ` Martin Jansa
2013-06-28 7:34 ` Robert Yang
-- strict thread matches above, loose matches on Subject: below --
2013-07-08 3:17 [PATCH 0/3 V2] " Robert Yang
2013-07-08 3:17 ` [PATCH 2/3] package_ipk.bbclass: " Robert Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371636603.6580.79.camel@phil-desktop.brightsign \
--to=pb@pbcl.net \
--cc=martin.jansa@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox