siteinfo: add existiance check for site config file

Submitted by Saul Wold on May 23, 2013, 2:37 p.m.

Details

Message ID 1369319832-24797-1-git-send-email-sgw@linux.intel.com
State New
Headers show

Commit Message

Saul Wold May 23, 2013, 2:37 p.m.
There is a condition where ncurses adds a site config file to CONFIG_SITE list
and then binutils configure tries to use the siteinfo list before ncurses has
installed the file.  The existance test is there in the BBPATH search, but not
in the SYSROOTCACHE check, so add it here.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/siteinfo.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index 09f88c6..87a4225 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -139,7 +139,8 @@  def siteinfo_get_files(d, no_cache = False):
     if os.path.isdir(path_siteconfig):
         for i in os.listdir(path_siteconfig):
             filename = os.path.join(path_siteconfig, i)
-            sitefiles += filename + " "
+            if os.path.exists(filename):
+                sitefiles += filename + " "
 
     return sitefiles
 

Comments

Saul Wold May 23, 2013, 3:51 p.m.
Ignore this patch, I was quick on the draw and did not notice the 
listdir which means the file is there,

Sau!

On 05/23/2013 07:37 AM, Saul Wold wrote:
> There is a condition where ncurses adds a site config file to CONFIG_SITE list
> and then binutils configure tries to use the siteinfo list before ncurses has
> installed the file.  The existance test is there in the BBPATH search, but not
> in the SYSROOTCACHE check, so add it here.
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>   meta/classes/siteinfo.bbclass | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
> index 09f88c6..87a4225 100644
> --- a/meta/classes/siteinfo.bbclass
> +++ b/meta/classes/siteinfo.bbclass
> @@ -139,7 +139,8 @@ def siteinfo_get_files(d, no_cache = False):
>       if os.path.isdir(path_siteconfig):
>           for i in os.listdir(path_siteconfig):
>               filename = os.path.join(path_siteconfig, i)
> -            sitefiles += filename + " "
> +            if os.path.exists(filename):
> +                sitefiles += filename + " "
>
>       return sitefiles
>
>
Mark Hatle May 23, 2013, 4:08 p.m.
On 5/23/13 10:51 AM, Saul Wold wrote:
>
>
> Ignore this patch, I was quick on the draw and did not notice the
> listdir which means the file is there,

Could the issue be that the file -was- there, then we ncurses updated it and now 
it's no longer there?  (or in the process of being written?)

I've definitely seen this failure before.. so there is some kind of race.

--Mark

> Sau!
>
> On 05/23/2013 07:37 AM, Saul Wold wrote:
>> There is a condition where ncurses adds a site config file to CONFIG_SITE list
>> and then binutils configure tries to use the siteinfo list before ncurses has
>> installed the file.  The existance test is there in the BBPATH search, but not
>> in the SYSROOTCACHE check, so add it here.
>>
>> Signed-off-by: Saul Wold <sgw@linux.intel.com>
>> ---
>>    meta/classes/siteinfo.bbclass | 3 ++-
>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
>> index 09f88c6..87a4225 100644
>> --- a/meta/classes/siteinfo.bbclass
>> +++ b/meta/classes/siteinfo.bbclass
>> @@ -139,7 +139,8 @@ def siteinfo_get_files(d, no_cache = False):
>>        if os.path.isdir(path_siteconfig):
>>            for i in os.listdir(path_siteconfig):
>>                filename = os.path.join(path_siteconfig, i)
>> -            sitefiles += filename + " "
>> +            if os.path.exists(filename):
>> +                sitefiles += filename + " "
>>
>>        return sitefiles
>>
>>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>