[OE-core] [PATCH 1/2] python3: fix create_manifest to handle pycache folders

Alejandro Enedino Hernandez Samaniego alejandro.enedino.hernandez-samaniego at xilinx.com
Fri Mar 30 06:28:16 UTC 2018


We have a couple of python modules that contain folders themselves,
for that reason they also contain a __pycache__ folder inside those
directories, since we include the whole folder in the manifest, the
pycache directories end up with the files and not the cache files.

This patch catches that and adds the directories to the correct
structure.

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr at xilinx.com>
---
 .../python/python3/create_manifest3.py               |  5 ++++-
 .../python/python3/python3-manifest.json             | 20 +++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py
index ead27e9..43e95ce 100644
--- a/meta/recipes-devtools/python/python3/create_manifest3.py
+++ b/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -186,7 +186,10 @@ for key in old_manifest:
         # Ignore folders, since we don't import those, difficult to handle multilib
         if isFolder(value):
             # Pass folders directly
-            new_manifest[key]['files'].append(value)
+            if isCached(value):
+                new_manifest[key]['cached'].append(value)
+            else:
+                new_manifest[key]['files'].append(value)
         # Ignore binaries, since we don't import those
         if '${bindir}' in value:
             # Pass it directly to the new manifest data structure
diff --git a/meta/recipes-devtools/python/python3/python3-manifest.json b/meta/recipes-devtools/python/python3/python3-manifest.json
index 95071c5..911be8e 100644
--- a/meta/recipes-devtools/python/python3/python3-manifest.json
+++ b/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -737,21 +737,21 @@
             "${libdir}/python3.5/__pycache__/poplib.*.pyc",
             "${libdir}/python3.5/__pycache__/smtplib.*.pyc",
             "${libdir}/python3.5/__pycache__/telnetlib.*.pyc",
-            "${libdir}/python3.5/__pycache__/uuid.*.pyc"
+            "${libdir}/python3.5/__pycache__/uuid.*.pyc",
+            "${libdir}/python3.5/http/__pycache__",
+            "${libdir}/python3.5/urllib/__pycache__"
         ],
         "files": [
             "${libdir}/python3.5/base64.py",
             "${libdir}/python3.5/ftplib.py",
             "${libdir}/python3.5/hmac.py",
             "${libdir}/python3.5/http",
-            "${libdir}/python3.5/http/__pycache__",
             "${libdir}/python3.5/mimetypes.py",
             "${libdir}/python3.5/nntplib.py",
             "${libdir}/python3.5/poplib.py",
             "${libdir}/python3.5/smtplib.py",
             "${libdir}/python3.5/telnetlib.py",
             "${libdir}/python3.5/urllib",
-            "${libdir}/python3.5/urllib/__pycache__",
             "${libdir}/python3.5/uuid.py"
         ],
         "rdepends": [
@@ -1088,11 +1088,12 @@
         "summary": "Python typing support"
     },
     "unittest": {
-        "cached": [],
+        "cached": [
+            "${libdir}/python3.5/unittest/__pycache__"
+        ],
         "files": [
             "${libdir}/python3.5/unittest",
-            "${libdir}/python3.5/unittest/",
-            "${libdir}/python3.5/unittest/__pycache__"
+            "${libdir}/python3.5/unittest/"
         ],
         "rdepends": [
             "core",
@@ -1132,11 +1133,12 @@
         "summary": "Python basic XML support"
     },
     "xmlrpc": {
-        "cached": [],
-        "files": [
-            "${libdir}/python3.5/xmlrpc",
+        "cached": [
             "${libdir}/python3.5/xmlrpc/__pycache__"
         ],
+        "files": [
+            "${libdir}/python3.5/xmlrpc"
+        ],
         "rdepends": [
             "core",
             "xml"
--
2.7.4

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.



More information about the Openembedded-core mailing list