[poky] [PATCH 0/1] Fix sstate error

Zhai, Edwin edwin.zhai at intel.com
Fri Feb 11 06:42:45 PST 2011



Richard Purdie wrote:
>
> On Fri, 2011-02-11 at 22:01 +0800, Zhai Edwin wrote:
> > From: Zhai Edwin <edwin.zhai at intel.com>
> >
> > RP,
> > Current sstate's fetch code doesn't reflect latest fetcher changes, 
> so old
> > fetch style cause exception and fail silently. This patch fix it.
>
> I've merged the fix to master, thanks.
>
> > Another issue is "import xxx" in python function from sstate.bbclass 
> can only
> > sit in the head of the function, else have UnboundLocalError: "local 
> variable
> > XXX referenced before assignment".
> >
> > We don't know if it is a known limitation of *.bbclass or some 
> potential bug.
> > Can you give some comments?
>
> Good question. The import should really always be at the top of the code
> block in question so I think its a python constraint, not a .bbclass
> one...
>

Seems in-middle "import" is widely used in other *.py,
See bitbake/lib/bb/fetch/ssh.py,
    def go(self, url, urldata, d):
..........................
        import commands
        cmd = 'scp -B -r %s %s %s/' % (
            port,
            commands.mkarg(fr),
            commands.mkarg(ldir)
        )

I found only bb has such limitation:all the "import bb.xxx" are in the 
head of function, and adding stuff before it will cause same problem. 
Anything special for bb module?

> Cheers,
>
> Richard
>
>
>
>
>
>
>



More information about the poky mailing list