Patchwork [1/2] distutils.bbclass: don't delete .pyo files

login
register
mail settings
Submitter Andreas Oberritter
Date May 21, 2012, 8:54 p.m.
Message ID <1337633664-19754-1-git-send-email-obi@opendreambox.org>
Download mbox | patch
Permalink /patch/28237/
State Accepted
Commit 25e186ad5b75bd2f93435857580bd16698e18e21
Headers show

Comments

Andreas Oberritter - May 21, 2012, 8:54 p.m.
* Deleting .pyo files causes them to get compiled on the target.
* First boot gets *really* slow for python based projects.
* No space gets saved on the target.
* The package manager doesn't know about the files and
  therefore fails to uninstall them, occupying space and causing
  uninstalled python scripts to remain executable.
* It's inconsistent, because python itself and autotools based
  projects already ship .pyo files.
* Probably .pyo files were deleted because .pyc files were
  available earlier, but this has changed and OE-Core's python
  now only generates optimized .pyo files. Deletion of .pyo was
  introduced in 2008, python/04-default-is-optimized.patch
  was introduced in 2009.

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
 meta/classes/distutils.bbclass |    4 ----
 1 file changed, 4 deletions(-)
Saul Wold - May 24, 2012, 5:57 p.m.
On 05/21/2012 01:54 PM, Andreas Oberritter wrote:
> * Deleting .pyo files causes them to get compiled on the target.
> * First boot gets *really* slow for python based projects.
> * No space gets saved on the target.
> * The package manager doesn't know about the files and
>    therefore fails to uninstall them, occupying space and causing
>    uninstalled python scripts to remain executable.
> * It's inconsistent, because python itself and autotools based
>    projects already ship .pyo files.
> * Probably .pyo files were deleted because .pyc files were
>    available earlier, but this has changed and OE-Core's python
>    now only generates optimized .pyo files. Deletion of .pyo was
>    introduced in 2008, python/04-default-is-optimized.patch
>    was introduced in 2009.
>
> Signed-off-by: Andreas Oberritter<obi@opendreambox.org>
> ---
>   meta/classes/distutils.bbclass |    4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
> index 18ae805..bcddf8d 100644
> --- a/meta/classes/distutils.bbclass
> +++ b/meta/classes/distutils.bbclass
> @@ -65,10 +65,6 @@ distutils_do_install() {
>           if test -e ${D}${datadir}/share; then
>               mv -f ${D}${datadir}/share/* ${D}${datadir}/
>           fi
> -
> -        # These are generated files, on really slow systems the storage/speed trade off
> -        # might be worth it, but in general it isn't
> -        find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \;
>   }
>
>   EXPORT_FUNCTIONS do_compile do_install


Merged these 2 into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index 18ae805..bcddf8d 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -65,10 +65,6 @@  distutils_do_install() {
         if test -e ${D}${datadir}/share; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
         fi
-
-        # These are generated files, on really slow systems the storage/speed trade off
-        # might be worth it, but in general it isn't 
-        find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \;
 }
 
 EXPORT_FUNCTIONS do_compile do_install