[OE-core] [PATCH] license: Improve disk usage

Richard Purdie richard.purdie at linuxfoundation.org
Mon Sep 15 14:12:13 UTC 2014


On Mon, 2014-09-15 at 15:58 +0200, Mike Looijmans wrote:
> I can probably come up with scenarios where "os.stat(src).st_dev == 
> os.stat(destdir).st_dev" but os.link will still fail.
> 
> Less code and does not assume that when src and destdir are on the same 
> device, they can be linked:
> 
> try:
>    os.link(src, dst)
> except:
>    shutil.copyfile(src, dst)

I agree that is probably easier. I'm curious which scenarios you're
thinking of though. We do have that device comparison elsewhere in the
codebase and I copied it mainly as it was how it was done elsewhere...

Cheers,

Richard




More information about the Openembedded-core mailing list