All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
Date: Thu, 17 May 2018 14:29:37 +0800	[thread overview]
Message-ID: <148bdddc-cb1e-f083-d6c8-10950aa72ba9@windriver.com> (raw)
In-Reply-To: <1526464678.32156.14.camel@andred.net>

Hi,

I've also noticed this problem. The growing testdata.json files also 
bothered me a little bit.

I think the only small flaw with your patch is you deleted the following 
check.

if testdata_link != testdata:

Checking the values of IMAGE_NAME and IMAGE_LINK_NAME in bitbake.conf, 
such check seems not necessary.
But these values could be overridden. How about still keeping such check?

Best Regards,
Chen Qi


On 05/16/2018 05:57 PM, André Draszik wrote:
> Is there anything wrong with this?
>
> On Thu, 2018-05-10 at 09:05 +0100, André Draszik wrote:
>> ping
>>
>> On Wed, 2018-03-21 at 16:31 +0000, André Draszik wrote:
>>> From: André Draszik <andre.draszik@jci.com>
>>>
>>> The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
>>> thus bypassing sstate, which results in an ever growing list
>>> of files.
>>>
>>> Write them to IMGDEPLOYDIR instead, so as to benefit from the
>>> automatic management via sstate.
>>>
>>> Signed-off-by: André Draszik <andre.draszik@jci.com>
>>>
>>> ---
>>> v2: fix typo in subject line
>>> ---
>>>   meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
>>>   1 file changed, 8 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/meta/classes/rootfs-postcommands.bbclass
>>> b/meta/classes/rootfs-postcommands.bbclass
>>> index a4e627fef8..01eee350b8 100644
>>> --- a/meta/classes/rootfs-postcommands.bbclass
>>> +++ b/meta/classes/rootfs-postcommands.bbclass
>>> @@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
>>>   python write_image_test_data() {
>>>       from oe.data import export2json
>>>   
>>> -    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'),
>>> d.getVar('IMAGE_NAME'))
>>> -    testdata_link = "%s/%s.testdata.json" %
>>> (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
>>> +    deploy_dir = d.getVar('IMGDEPLOYDIR')
>>> +    link_name = d.getVar('IMAGE_LINK_NAME')
>>> +    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" %
>>> d.getVar('IMAGE_NAME'))
>>>   
>>> -    bb.utils.mkdirhier(os.path.dirname(testdata))
>>>       searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
>>> -    export2json(d, testdata,searchString=searchString,replaceString="")
>>> +    export2json(d, testdata_name, searchString=searchString,
>>> replaceString="")
>>>   
>>> -    if testdata_link != testdata:
>>> +    if os.path.exists(testdata_name):
>>> +        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" %
>>> link_name)
>>>           if os.path.lexists(testdata_link):
>>> -           os.remove(testdata_link)
>>> -        os.symlink(os.path.basename(testdata), testdata_link)
>>> +            os.remove(testdata_link)
>>> +        os.symlink(os.path.basename(testdata_name), testdata_link)
>>>   }
>>>   write_image_test_data[vardepsexclude] += "TOPDIR"
>>>   




  reply	other threads:[~2018-05-17  6:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 13:00 [PATCH] rootfs-postcommaneds: put image testdata under sstate control André Draszik
2018-03-21 16:31 ` [PATCH v2] rootfs-postcommands: " André Draszik
2018-05-10  8:05   ` André Draszik
2018-05-16  9:57     ` André Draszik
2018-05-17  6:29       ` ChenQi [this message]
2018-05-21 14:54         ` André Draszik
2018-08-08 11:56       ` André Draszik
2018-08-20  8:15 ` [PATCH v3] " André Draszik

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=148bdddc-cb1e-f083-d6c8-10950aa72ba9@windriver.com \
    --to=qi.chen@windriver.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 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.