[OE-core] [RFC PATCH] package.bbclass: omit .pyc and .pyo file

ChenQi Qi.Chen at windriver.com
Wed Jan 7 02:07:38 UTC 2015


On 01/07/2015 09:07 AM, Robert Yang wrote:
> We should not ship .pyc or .pyo file, but there are a few packages
> ship .pyc, should we:
> 1) Ignore them in package.bbclass as this patch showes ?
> Or
> 2) Add a qa check  then fix it by hand one by one ?

3) Fix it in a bbclass that python related recipes would generally inherit.

Regards,
Chen Qi

> Here is the list of oe-core's world build:
> python-smartpm-1.4.1
> nativesdk-python-smartpm-1.4.1
> python3-distribute-0.6.32
> python-pycurl-7.19.5
> python-pyrex-0.9.9
> python-numpy-1.7.0
> python-distribute-0.6.32
> python-async-0.6.1
> python-docutils-0.12
> python-pycairo-1.10.0
> python-scons-2.3.2
> python-imaging-1.1.7
> python-gitdb-0.5.4
>
> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
> ---
>   meta/classes/package.bbclass |    6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index fc501fc..6960221 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1022,6 +1022,9 @@ python populate_packages () {
>               files.append(file)
>   
>           for file in files:
> +            # Skip .pyc and .pyo file.
> +            if file.endswith('.pyc') or file.endswith('.pyo'):
> +                continue
>               if not cpath.islink(file):
>                   if cpath.isdir(file):
>                       newfiles =  [ os.path.join(file,x) for x in os.listdir(file) ]
> @@ -1083,6 +1086,9 @@ python populate_packages () {
>           if not dir:
>               dir = os.sep
>           for f in (files + dirs):
> +            # Skip .pyc and .pyo file.
> +            if f.endswith('.pyc') or f.endswith('.pyo'):
> +                continue
>               path = os.path.join(dir, f)
>               if ('.' + path) not in seen:
>                   unshipped.append(path)




More information about the Openembedded-core mailing list