]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils.bbclass: Handle python-backport modules
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>
Thu, 10 Sep 2015 15:51:33 +0000 (15:51 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 14 Sep 2015 09:44:05 +0000 (10:44 +0100)
When installing backport modules they stumble upon each other, complaining with
the following error:

ERROR: The recipe python-backports-ssl is trying to install files into a shared
area when those files already exist.

This is the correct behavior since thats just the way they were designed, all backport
modules provide an __init__.py file (the same among all packages), and without it they
simply wouldnt work.

distutils handles FILES_${PN}* variables for python packages, but it uses wildcards
to include the required files, hence removing the __init__.py files from each backport
package during build time is impossible since it doenst actually contain that value,
this patch simply removes the __init__.py* files from the staging area if they already
exist on sysroot, this way, these are not included in FILES_${PN} anymore, fixing the
issue mentioned above.

[YOCTO #8207]

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/distutils.bbclass

index 2498685d66e5a59eb5353e61f9d5087c968ca9ed..cd06713882eb0ef7c5693f4da830db2c866077e8 100644 (file)
@@ -73,6 +73,12 @@ distutils_do_install() {
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
             rmdir ${D}${datadir}/share
         fi
+
+       # Fix backport modules
+       if test -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py && test -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py; then
+          rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
+          rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
+       fi
 }
 
 EXPORT_FUNCTIONS do_compile do_install