All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package_ipk.bbclass: Include a space followed by a dot for empty description lines
@ 2017-05-03 19:26 leonardo.sandoval.gonzalez
  2017-05-04 11:13 ` Burton, Ross
  2017-05-22 16:43 ` [PATCH v2] package_ipk: correct ipk descriptions leonardo.sandoval.gonzalez
  0 siblings, 2 replies; 9+ messages in thread
From: leonardo.sandoval.gonzalez @ 2017-05-03 19:26 UTC (permalink / raw)
  To: openembedded-core

From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

As described in [1], "Empty lines in field values are usually escaped by representing
them by a space followed by a dot." so default to the latter.

[1] https://www.debian.org/doc/debian-policy/ch-controlfields.html

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
 meta/classes/package_ipk.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index c7cec9d63d1..168511cc16b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -148,7 +148,7 @@ python do_package_ipk () {
                         line = textwrap.fill(t.strip(),
                                              width=100000,
                                              initial_indent=' ',
-                                             subsequent_indent=' ') or '.'
+                                             subsequent_indent=' ') or ' .'
                         ctrlfile.write('%s\n' % line)
                 else:
                     # Auto indent
-- 
2.12.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] package_ipk.bbclass: Include a space followed by a dot for empty description lines
  2017-05-03 19:26 [PATCH] package_ipk.bbclass: Include a space followed by a dot for empty description lines leonardo.sandoval.gonzalez
@ 2017-05-04 11:13 ` Burton, Ross
  2017-05-22 16:43 ` [PATCH v2] package_ipk: correct ipk descriptions leonardo.sandoval.gonzalez
  1 sibling, 0 replies; 9+ messages in thread
From: Burton, Ross @ 2017-05-04 11:13 UTC (permalink / raw)
  To: Leonardo Sandoval; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

On 3 May 2017 at 20:26, <leonardo.sandoval.gonzalez@linux.intel.com> wrote:

>                          line = textwrap.fill(t.strip(),
>                                               width=100000,
>                                               initial_indent=' ',
> -                                             subsequent_indent=' ') or '.'
> +                                             subsequent_indent=' ') or '
> .'
>

The dpkg patch removes use of textwrap: so why bother with textwrap if the
wrapping width is 100000 characters?

Ross

[-- Attachment #2: Type: text/html, Size: 1135 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] package_ipk: correct ipk descriptions
  2017-05-03 19:26 [PATCH] package_ipk.bbclass: Include a space followed by a dot for empty description lines leonardo.sandoval.gonzalez
  2017-05-04 11:13 ` Burton, Ross
@ 2017-05-22 16:43 ` leonardo.sandoval.gonzalez
  2017-05-24 20:15   ` Burton, Ross
  2017-05-29 17:36   ` [PATCH v3] package_ipk: correct ipk multiline descriptions leonardo.sandoval.gonzalez
  1 sibling, 2 replies; 9+ messages in thread
From: leonardo.sandoval.gonzalez @ 2017-05-22 16:43 UTC (permalink / raw)
  To: openembedded-core

From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

Empty descriptions are set with a space following by a dot. For the non-empty ones,
there is no need for formating the description with textwrap, so remove the logic
for the latter.

[YOCTO #10677]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
 meta/classes/package_ipk.bbclass | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 5cc7e0a7b24..862cc3c730b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -150,14 +150,7 @@ def ipk_write_pkg(pkg, d):
                 if '\\n' in description:
                     # Manually indent
                     for t in description.split('\\n'):
-                        # We don't limit the width when manually indent, but we do
-                        # need the textwrap.fill() to set the initial_indent and
-                        # subsequent_indent, so set a large width
-                        line = textwrap.fill(t.strip(),
-                                             width=100000,
-                                             initial_indent=' ',
-                                             subsequent_indent=' ') or '.'
-                        ctrlfile.write('%s\n' % line)
+                        ctrlfile.write('%s\n' % (t.strip() or ' .'))
                 else:
                     # Auto indent
                     ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
-- 
2.12.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] package_ipk: correct ipk descriptions
  2017-05-22 16:43 ` [PATCH v2] package_ipk: correct ipk descriptions leonardo.sandoval.gonzalez
@ 2017-05-24 20:15   ` Burton, Ross
  2017-05-24 20:47     ` Leonardo Sandoval
  2017-05-29 17:36   ` [PATCH v3] package_ipk: correct ipk multiline descriptions leonardo.sandoval.gonzalez
  1 sibling, 1 reply; 9+ messages in thread
From: Burton, Ross @ 2017-05-24 20:15 UTC (permalink / raw)
  To: Leonardo Sandoval; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

On 22 May 2017 at 17:43, <leonardo.sandoval.gonzalez@linux.intel.com> wrote:

> Empty descriptions are set with a space following by a dot. For the
> non-empty ones,
> there is no need for formating the description with textwrap, so remove
> the logic
> for the latter.
>

Looks like opkg doesn't behave like this as building lzop fails (which has
lots of newlines embedded in the SUMMARY).

Ross

[-- Attachment #2: Type: text/html, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] package_ipk: correct ipk descriptions
  2017-05-24 20:15   ` Burton, Ross
@ 2017-05-24 20:47     ` Leonardo Sandoval
  2017-05-24 22:08       ` Burton, Ross
  0 siblings, 1 reply; 9+ messages in thread
From: Leonardo Sandoval @ 2017-05-24 20:47 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, 2017-05-24 at 21:15 +0100, Burton, Ross wrote:
> 
> On 22 May 2017 at 17:43, <leonardo.sandoval.gonzalez@linux.intel.com>
> wrote:
>         Empty descriptions are set with a space following by a dot.
>         For the non-empty ones,
>         there is no need for formating the description with textwrap,
>         so remove the logic
>         for the latter.
>         
> 
> Looks like opkg doesn't behave like this as building lzop fails (which
> has lots of newlines embedded in the SUMMARY).

I will check that particular recipe and bb world just so see if some
other recipe is broken with this change, then provide a v3.

Leo
> 
> 
> Ross




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] package_ipk: correct ipk descriptions
  2017-05-24 20:47     ` Leonardo Sandoval
@ 2017-05-24 22:08       ` Burton, Ross
  2017-05-29 17:24         ` Leonardo Sandoval
  0 siblings, 1 reply; 9+ messages in thread
From: Burton, Ross @ 2017-05-24 22:08 UTC (permalink / raw)
  To: Leonardo Sandoval; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

On 24 May 2017 at 21:47, Leonardo Sandoval <
leonardo.sandoval.gonzalez@linux.intel.com> wrote:

> I will check that particular recipe and bb world just so see if some
> other recipe is broken with this change, then provide a v3.
>

And double check what opkg expects :)

Ross

[-- Attachment #2: Type: text/html, Size: 716 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] package_ipk: correct ipk descriptions
  2017-05-24 22:08       ` Burton, Ross
@ 2017-05-29 17:24         ` Leonardo Sandoval
  0 siblings, 0 replies; 9+ messages in thread
From: Leonardo Sandoval @ 2017-05-29 17:24 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, 2017-05-24 at 23:08 +0100, Burton, Ross wrote:
> 
> On 24 May 2017 at 21:47, Leonardo Sandoval
> <leonardo.sandoval.gonzalez@linux.intel.com> wrote:
>         I will check that particular recipe and bb world just so see
>         if some
>         other recipe is broken with this change, then provide a v3.
>         
> 
> And double check what opkg expects :)
> 
Right.  in my narrow Google search I can see that ipk is poorly
documented but this is what I found from web archive [1]

"Description should be a short, (less than 80 characters) description of
the program. It may also include a long description on subsequent lines,
(each indented by a single space character). Blank lines in the long
description may be indicated by a line consisting of a space character
followed by a period, ie " ."


So a multiline description, every line (including the first one) must
have a leading space. I tried the latter and worked so v3 to be sent
soon.


https://web.archive.org/web/20100727133051/http://handhelds.org:80/moin/moin.cgi/BuildingIpkgs
> 
> Ross




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3] package_ipk: correct ipk multiline descriptions
  2017-05-22 16:43 ` [PATCH v2] package_ipk: correct ipk descriptions leonardo.sandoval.gonzalez
  2017-05-24 20:15   ` Burton, Ross
@ 2017-05-29 17:36   ` leonardo.sandoval.gonzalez
  2017-05-29 21:41     ` Andreas Oberritter
  1 sibling, 1 reply; 9+ messages in thread
From: leonardo.sandoval.gonzalez @ 2017-05-29 17:36 UTC (permalink / raw)
  To: openembedded-core

From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

Empty descriptions lines are set with a space following by a dot and
the multiline ones require a leading space. Also, for non-empty lines,
there is no need for formating with textwrap, so remove the logic for
the latter. The documentation for multiline description was taken from [1].

[1] https://web.archive.org/web/20100727133051/http://handhelds.org:80/moin/moin.cgi/BuildingIpkgs

[YOCTO #10677]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
 meta/classes/package_ipk.bbclass | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 5cc7e0a7b24..d2ce3b3e17a 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -148,16 +148,9 @@ def ipk_write_pkg(pkg, d):
                 description = localdata.getVar('DESCRIPTION') or "."
                 description = textwrap.dedent(description).strip()
                 if '\\n' in description:
-                    # Manually indent
+                    # Manually indent: multiline description includes a leading space
                     for t in description.split('\\n'):
-                        # We don't limit the width when manually indent, but we do
-                        # need the textwrap.fill() to set the initial_indent and
-                        # subsequent_indent, so set a large width
-                        line = textwrap.fill(t.strip(),
-                                             width=100000,
-                                             initial_indent=' ',
-                                             subsequent_indent=' ') or '.'
-                        ctrlfile.write('%s\n' % line)
+                        ctrlfile.write(' %s\n' % (t.strip() or ' .'))
                 else:
                     # Auto indent
                     ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
-- 
2.12.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] package_ipk: correct ipk multiline descriptions
  2017-05-29 17:36   ` [PATCH v3] package_ipk: correct ipk multiline descriptions leonardo.sandoval.gonzalez
@ 2017-05-29 21:41     ` Andreas Oberritter
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Oberritter @ 2017-05-29 21:41 UTC (permalink / raw)
  To: openembedded-core

On Mon, 29 May 2017 10:36:47 -0700
leonardo.sandoval.gonzalez@linux.intel.com wrote:

> From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
> 
> Empty descriptions lines are set with a space following by a dot and
> the multiline ones require a leading space. Also, for non-empty lines,
> there is no need for formating with textwrap, so remove the logic for
> the latter. The documentation for multiline description was taken from [1].
> 
> [1] https://web.archive.org/web/20100727133051/http://handhelds.org:80/moin/moin.cgi/BuildingIpkgs
> 
> [YOCTO #10677]
> 
> Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
> ---
>  meta/classes/package_ipk.bbclass | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
> index 5cc7e0a7b24..d2ce3b3e17a 100644
> --- a/meta/classes/package_ipk.bbclass
> +++ b/meta/classes/package_ipk.bbclass
> @@ -148,16 +148,9 @@ def ipk_write_pkg(pkg, d):
>                  description = localdata.getVar('DESCRIPTION') or "."
>                  description = textwrap.dedent(description).strip()
>                  if '\\n' in description:
> -                    # Manually indent
> +                    # Manually indent: multiline description includes a leading space
>                      for t in description.split('\\n'):
> -                        # We don't limit the width when manually indent, but we do
> -                        # need the textwrap.fill() to set the initial_indent and
> -                        # subsequent_indent, so set a large width
> -                        line = textwrap.fill(t.strip(),
> -                                             width=100000,
> -                                             initial_indent=' ',
> -                                             subsequent_indent=' ') or '.'
> -                        ctrlfile.write('%s\n' % line)
> +                        ctrlfile.write(' %s\n' % (t.strip() or ' .'))

Why not fix opkg instead, if it handles the format incorrectly? After all,
opkg claims to use the dpkg package format, AFAIR. It might be worth looking
how OpenWrt handles multi-line descriptions. Maybe they fixed it already in
their version.

Regards,
Andreas


>                  else:
>                      # Auto indent
>                      ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-29 21:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 19:26 [PATCH] package_ipk.bbclass: Include a space followed by a dot for empty description lines leonardo.sandoval.gonzalez
2017-05-04 11:13 ` Burton, Ross
2017-05-22 16:43 ` [PATCH v2] package_ipk: correct ipk descriptions leonardo.sandoval.gonzalez
2017-05-24 20:15   ` Burton, Ross
2017-05-24 20:47     ` Leonardo Sandoval
2017-05-24 22:08       ` Burton, Ross
2017-05-29 17:24         ` Leonardo Sandoval
2017-05-29 17:36   ` [PATCH v3] package_ipk: correct ipk multiline descriptions leonardo.sandoval.gonzalez
2017-05-29 21:41     ` Andreas Oberritter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.