<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10677</bug_id>
          
          <creation_ts>2016-11-16 09:11:30 +0000</creation_ts>
          <short_desc>\n in DESCRIPTION creates invalid (ipk) packages</short_desc>
          <delta_ts>2017-06-01 14:45:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>deployment</component>
          <version>2.2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="André Draszik">byo</reporter>
          <assigned_to name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</assigned_to>
          <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68356</commentid>
    <comment_count>0</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2016-11-16 09:11:30 +0000</bug_when>
    <thetext>As per
http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128842.html

It looks like having explicit \n in the DESCRIPTION causes creation of ipks that can&apos;t be installed:

root@poky:~# opkg update
Package ncp-dbg version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp-dev version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp-doc version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp version 1.2.4-r0 has no valid architecture, ignoring.

root@poky:~# opkg install ncp
Package ncp-dbg version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp-dev version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp-doc version 1.2.4-r0 has no valid architecture, ignoring.
Package ncp version 1.2.4-r0 has no valid architecture, ignoring.
Collected errors:
 * opkg_prepare_url_for_install: Couldn&apos;t find anything to satisfy &apos;ncp&apos;.


I would think that this should either be caught early, i.e. bitbake should fail, or alternatively be fixed if possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68498</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-11-22 17:25:50 +0000</bug_when>
    <thetext>Estimated time may increase, but setting to 1 to do the first analysis/setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69882</commentid>
    <comment_count>2</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-18 11:07:12 +0000</bug_when>
    <thetext>For reference, this version&apos;s DESCRIPTION caused the issue: http://lists.openembedded.org/pipermail/openembedded-devel/2016-November/109835.html

Whereas this is fine:
http://lists.openembedded.org/pipermail/openembedded-devel/2016-November/109885.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69885</commentid>
    <comment_count>3</comment_count>
    <who name="André Draszik">byo</who>
    <bug_when>2017-01-18 12:25:01 +0000</bug_when>
    <thetext>The comment from http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128851.html is actually correct. The problem is empty lines anywhere in the DESCRIPTION, not just at the end. By making sure there are no empty lines, e.g by adding a &apos;dot&apos;, the resulting package can be installed without architecture mismatches (we can&apos;t use &apos;space&apos; instead of &apos;dot&apos;, because opkg-utils&apos; opkg.py runs textwrap.dedent() and strip() first):

&gt; DESCRIPTION = &quot;ncp is a utility for copying files in a LAN. It has absolutely no \n\
&gt; security or integrity checking, no throttling, no features, except \n\
&gt; one: you don&apos;t have to type the coordinates of your peer. \n\
&gt; .\n\
&gt; Please note that the DNS resolver does not use /etc/hosts (as that \n\
&gt; would not work with IPv6 anyway), so you should have a properly \n\
&gt; configured DNS server. \n\
&gt; .\n\
&gt; Basically it works like this: \n\
&gt;    1. You and your buddy want to play Quake \n\
&gt;    2. Your buddy has a level that you don&apos;t have \n\
&gt;    3. He types npush filename and waits. npush sends out UDP \n\
&gt;       announcement packets proclaiming that someone wants to send \n\
&gt;       something \n\
&gt;    4. You type npoll. npoll waits until it sees one of these packets \n\
&gt;    5. The files are copied with tar over a TCP socket, so permissions \n\
&gt;       and file dates (and if you are root, owners) are preserved. \n\
&gt; .\n\
&gt; There are other usage modes. You can also use it like this: \n\
&gt;    peer1$ ncp \n\
&gt;                            peer2$ ncp peer1 file1 file2 file3 \n\
&gt; or like this: \n\
&gt;    peer1$ npush file1 \n\
&gt;                            peer2$ npoll peer1&quot;

So I suppose the packaging could maybe be enhanced to either fail early in such a case, or to add the dots itself, or to skip the python textwrap part if pre-formatted text has been detected</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70034</commentid>
    <comment_count>4</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-01-23 18:22:07 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; So I suppose the packaging could maybe be enhanced to either fail early in
&gt; such a case, or to add the dots itself, or to skip the python textwrap part
&gt; if pre-formatted text has been detected

It seems the best option is to add a sanity test to check if the description empty lines.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70035</commentid>
    <comment_count>5</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-01-23 18:24:07 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; So I suppose the packaging could maybe be enhanced to either fail early in
&gt; &gt; such a case, or to add the dots itself, or to skip the python textwrap part
&gt; &gt; if pre-formatted text has been detected
&gt; 
&gt; It seems the best option is to add a sanity test to check if the description
&gt; empty lines.

I hit the button too early, the best option would be to check if description has empty lines at build time and make the task fail, because opkg expect an empty line as terminator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70091</commentid>
    <comment_count>6</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-01-24 18:43:09 +0000</bug_when>
    <thetext>Sent patch for review:

https://patchwork.openembedded.org/series/4942/#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70919</commentid>
    <comment_count>7</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-02-23 17:01:46 +0000</bug_when>
    <thetext>In general opkg matches dpkg, so using &apos;.&apos; to &apos;escape&apos; blank lines seems like the best idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71250</commentid>
    <comment_count>8</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-03-14 15:11:41 +0000</bug_when>
    <thetext>Moving to M4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72104</commentid>
    <comment_count>9</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2017-04-05 19:00:02 +0000</bug_when>
    <thetext>Sent v2 to the mailing list, this version does what Ross suggested:

http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135233.html

Patchwork:

https://patchwork.openembedded.org/series/6176/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72473</commentid>
    <comment_count>10</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-04-13 15:20:47 +0000</bug_when>
    <thetext>Patch is out there, ping will be done during 2.4M1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72617</commentid>
    <comment_count>11</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-04-18 20:33:36 +0000</bug_when>
    <thetext>Merged in oe-core 3e678d9b6a9eaeed76ce538d7f6ecf9f423864bc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73007</commentid>
    <comment_count>12</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-05-03 16:28:42 +0000</bug_when>
    <thetext>So I was wrong...

The format for empty lines in description is &quot; .&quot;.

package_deb was just patched to fix the same problem there:

-                         # We don&apos;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
-                         ctrlfile.write(&apos;%s\n&apos; % textwrap.fill(t, width=100000, initial_indent=&apos; &apos;, subsequent_indent=&apos; &apos;))
+                         ctrlfile.write(&apos; %s\n&apos; % (t.strip() or &apos;.&apos;))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73018</commentid>
    <comment_count>13</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-03 19:27:36 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; So I was wrong...
&gt; 
&gt; The format for empty lines in description is &quot; .&quot;.
&gt; 
&gt; package_deb was just patched to fix the same problem there:
&gt; 
&gt; -                         # We don&apos;t limit the width when manually indent,
&gt; but we do
&gt; -                         # need the textwrap.fill() to set the
&gt; initial_indent and
&gt; -                         # subsequent_indent, so set a large width
&gt; -                         ctrlfile.write(&apos;%s\n&apos; % textwrap.fill(t,
&gt; width=100000, initial_indent=&apos; &apos;, subsequent_indent=&apos; &apos;))
&gt; +                         ctrlfile.write(&apos; %s\n&apos; % (t.strip() or &apos;.&apos;))

Patch sent with the correction:

http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136287.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73117</commentid>
    <comment_count>14</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-08 14:38:09 +0000</bug_when>
    <thetext>This is suggested (by Ross) way to fix this problem

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ross/mut&amp;id=a428745d1594219413032d89065b522ff84a6ad3

So I will send another revision before M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73418</commentid>
    <comment_count>15</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-22 17:34:14 +0000</bug_when>
    <thetext>V2 revision sent for review:

http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136974.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73548</commentid>
    <comment_count>16</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-29 17:41:25 +0000</bug_when>
    <thetext>Sent v3

http://lists.openembedded.org/pipermail/openembedded-core/2017-May/137286.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73604</commentid>
    <comment_count>17</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-01 14:45:31 +0000</bug_when>
    <thetext>Merged at http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=41dcb7d3bd666798e3a862d3a09e716eb0492f26</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>