Openembedded Core Discussions
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/1] sanity.bbclass: check for validity of TMPDIR
Date: Fri, 15 Nov 2013 10:41:09 +0800	[thread overview]
Message-ID: <528589C5.8050107@windriver.com> (raw)
In-Reply-To: <1384434732.6460.121.camel@ted>

On 11/14/2013 09:12 PM, Richard Purdie wrote:
> On Thu, 2013-11-14 at 21:07 +0800, Qi.Chen@windriver.com wrote:
>> From: Chen Qi <Qi.Chen@windriver.com>
>>
>> TMPDIR must be an absolute path, otherwise, the build will fail.
>> Special characters in TMPDIR will also cause build failures.
>>
>> This patch enables checking for the validity of TMPDIR.
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   meta/classes/sanity.bbclass |    7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>> index 83378b0..e45906e 100644
>> --- a/meta/classes/sanity.bbclass
>> +++ b/meta/classes/sanity.bbclass
>> @@ -672,6 +672,13 @@ def check_sanity_everybuild(status, d):
>>           with open(checkfile, "w") as f:
>>               f.write(tmpdir)
>>   
>> +    # Check if TMPDIR contains invalid characters, and check if it is an absolute path
>> +    valid_tmpdir_regexp = "^/[a-zA-Z0-9\-_/.~]+$"
>> +    import re
>> +    valid_pattern = re.compile(valid_tmpdir_regexp)
>> +    if not valid_pattern.match(tmpdir):
>> +        status.addresult("Error, you have special characters in TMPDIR directory path or your TMPDIR is not an absolute path. The TMPDIR should match the this regexp: ^/[a-zA-Z0-9\-_/.~]$")
>> +
> I'm ok with the check itself however this does not need to be run every
> build. It needs to run when tmpdir changes only.
>
> Cheers,
>
> Richard
>
>
>
>

Thanks for pointing it out.

I've changed the logic a little bit.
1. Create the directory hierarchy for TMPDIR only if TMPDIR is valid
2. Handle ABI version change only if TMPDIR has been created.

So only when we had a valid TMPDIR for last build and this time the 
TMPDIR hasn't changed location, we don't check the validity for TMPDIR.

I've sent out  a V2.

Best Regards,
Chen Qi


  reply	other threads:[~2013-11-15  2:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 13:07 [PATCH 0/1] sanity.bbclass: check for validity of TMPDIR Qi.Chen
2013-11-14 13:07 ` [PATCH 1/1] " Qi.Chen
2013-11-14 13:12   ` Richard Purdie
2013-11-15  2:41     ` ChenQi [this message]
2013-11-14 13:27   ` Gary Thomas
2013-11-14 13:42     ` Phil Blundell
2013-11-14 13:50       ` Gary Thomas
2013-11-14 15:49       ` Mark Hatle
2013-11-14 16:04         ` Phil Blundell
2013-11-14 18:02           ` Mark Hatle
2013-11-14 18:01         ` Saul Wold
2013-11-15  2:49           ` ChenQi
2013-11-15  2:44 ` [PATCH 0/1] " ChenQi

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=528589C5.8050107@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.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