Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2] distutils.bbclass: Handle python-backport modules
Date: Thu, 10 Sep 2015 15:51:33 +0000	[thread overview]
Message-ID: <1441900293-11027-1-git-send-email-alejandro.hernandez@linux.intel.com> (raw)

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>
---
 meta/classes/distutils.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index 2498685..42b13f5 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -44,7 +44,6 @@ distutils_do_install() {
         # support filenames with *spaces*
         # only modify file if it contains path  and recompile it
         find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \; -exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
-
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
                 if [ ${PN} != "${BPN}-native" ]; then
@@ -73,6 +72,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
-- 
1.8.4.5



                 reply	other threads:[~2015-09-10 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441900293-11027-1-git-send-email-alejandro.hernandez@linux.intel.com \
    --to=alejandro.hernandez@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox