All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denys@ti.com>
To: "Stiffler, Jacob" <j-stiffler@ti.com>
Cc: "meta-arago@arago-project.org" <meta-arago@arago-project.org>
Subject: Re: [PATCH v3] tisdk-image: Fix manifest generation for nativesdk.
Date: Fri, 13 Mar 2015 16:20:19 -0400	[thread overview]
Message-ID: <20150313202019.GE26701@edge> (raw)
In-Reply-To: <4B26FB5A64EBA14C87266869E037F958141088E7@DFLE09.ent.ti.com>

I don't have any issues with the patch, per se, but wouldn't the main logic to 
break up package index be better written in awk? :)


On Fri, Mar 13, 2015 at 10:47:28AM +0000, Stiffler, Jacob wrote:
> Ping. 
> 
> Anything preventing this from being committed? I have another patch on top 
> of this to also support the text format.
> 
> Thanks,
> Jake
> 
> -----Original Message-----
> From: Stiffler, Jacob 
> Sent: Monday, March 09, 2015 1:55 PM
> To: meta-arago@arago-project.org
> Cc: Stiffler, Jacob
> Subject: [PATCH v3] tisdk-image: Fix manifest generation for nativesdk.
> 
> The software manifest is created by parsing the *.control files in the images /var/lib/opkg directory. For the nativesdk sysroot, there are some cases where the control files are not present. The reason for this and the specific circumstances of when this occurs has not yet been root caused.
> 
> When this does happen, the "Development Host Content" tables of the manifest are not valid. However, the package indexes are present. These contain all of the information in the control files, only concatenated together in a large file. This patch will split up these package indexes into individual control files which will allow the previous parsing to produce a valid output.
> 
> Here is an example of the invalid output when the control files are not present:
> 
> <h2><u>Development Host Content</u></h2> <p>This table describes any software being delivered that is expected to run on a Development Host, instead of the target device.  Some of this software may be licensed under GPLv3 but it is not expected to be shipped as a product.</p>
> 
> <table border=1 cellspacing=1 cellpadding=1 width=80%> <tr bgcolor=#c0c0c0  color=white>
>     <td><b>Software Name</b></td>
>     <td><b>Version</b></td>
>     <td><b>License</b></td>
>     <td><b>Location</b></td>
>     <td><b>Delivered As</b></td>
>     <td><b>Modified by TI</b></td>
>     <td><b>Obtained from</b></td>
> </tr>
> 
> <tr>
>     <td> </td>
>     <td></td>
>     <td ></td>
>     <td>__.ipk</td>
>     <td>Binary</td>
>     <td>No</td>
>     <td></td>
> </tr>
> 
> Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
> ---
>  meta-arago-distro/classes/tisdk-image.bbclass |   37 +++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/meta-arago-distro/classes/tisdk-image.bbclass b/meta-arago-distro/classes/tisdk-image.bbclass
> index 3030a38..747670f 100644
> --- a/meta-arago-distro/classes/tisdk-image.bbclass
> +++ b/meta-arago-distro/classes/tisdk-image.bbclass
> @@ -353,6 +353,43 @@ echo "
>  </tr>
>  " >> ${SW_MANIFEST_FILE}
>  
> +    control_files_there=0
> +    for possible_control_file in $control_dir/*.control
> +    do
> +        if [ -f $possible_control_file ]
> +        then
> +            control_files_there=1
> +            break
> +        fi
> +    done
> +
> +    if [ $control_files_there -eq 0 ]
> +    then
> +        for pkg_idx in $control_dir/oe*; do
> +            package_start=`grep -n "^Package" $pkg_idx || true`
> +
> +            IFS_OLD=${IFS}
> +            IFS="
> +"
> +
> +            for pkg in ${package_start}; do
> +                end=`echo $pkg | cut -d: -f1`
> +
> +                if [ -z $begin ]; then
> +                    pkg_name=`echo $pkg | cut -d: -f3`
> +                    begin=`echo $pkg | cut -d: -f1`
> +                    continue
> +                fi
> +                cnt=$[$cnt+1]
> +                head -n $[$end - 1] $pkg_idx | tail -n $[$end - $begin] 
> + > ${control_dir}/${pkg_name// /}.control
> +
> +                pkg_name=`echo $pkg | cut -d: -f3`
> +                begin=$end
> +            done
> +            IFS=${IFS_OLD}
> +        done
> +    fi
> +
>      for i in $control_dir/*.control
>      do
>          package="`cat $i | grep Package: | awk {'print $2'}`"
> --
> 1.7.9.5
> 
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


      reply	other threads:[~2015-03-13 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 17:55 [PATCH v3] tisdk-image: Fix manifest generation for nativesdk Jacob Stiffler
2015-03-13 10:47 ` Stiffler, Jacob
2015-03-13 20:20   ` Denys Dmytriyenko [this message]

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=20150313202019.GE26701@edge \
    --to=denys@ti.com \
    --cc=j-stiffler@ti.com \
    --cc=meta-arago@arago-project.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 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.