diff options
author | Alejandro Enedino Hernandez Samaniego <alejandro.enedino.hernandez-samaniego@xilinx.com> | 2018-09-05 10:53:37 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-09-06 10:36:31 +0100 |
commit | c05304f1eaf40df51c480abc293e6b0465bf91f6 (patch) | |
tree | 9226cb68d3dc84a068e6f8ec08cd9715ba113f5d /meta/recipes-devtools/python | |
parent | a8a984dde7e4227be5f2104643226575f5c58c59 (diff) | |
download | poky-c05304f1eaf40df51c480abc293e6b0465bf91f6.tar.gz |
python3: fix indentation on create_manifest3
(From OE-Core rev: 76b4596c3782590bd27a7d46c2b64393c3a83944)
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python3/create_manifest3.py | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/meta/recipes-devtools/python/python3/create_manifest3.py b/meta/recipes-devtools/python/python3/create_manifest3.py index 1849152ea3..2db5e3b0b6 100644 --- a/meta/recipes-devtools/python/python3/create_manifest3.py +++ b/meta/recipes-devtools/python/python3/create_manifest3.py | |||
@@ -50,8 +50,8 @@ pyversion = str(sys.argv[1]) | |||
50 | # Hack to get native python search path (for folders), not fond of it but it works for now | 50 | # Hack to get native python search path (for folders), not fond of it but it works for now |
51 | pivot = 'recipe-sysroot-native' | 51 | pivot = 'recipe-sysroot-native' |
52 | for p in sys.path: | 52 | for p in sys.path: |
53 | if pivot in p: | 53 | if pivot in p: |
54 | nativelibfolder = p[:p.find(pivot)+len(pivot)] | 54 | nativelibfolder = p[:p.find(pivot)+len(pivot)] |
55 | 55 | ||
56 | # Empty dict to hold the whole manifest | 56 | # Empty dict to hold the whole manifest |
57 | new_manifest = {} | 57 | new_manifest = {} |
@@ -65,21 +65,21 @@ hasfolders = [] | |||
65 | allfolders = [] | 65 | allfolders = [] |
66 | 66 | ||
67 | def isFolder(value): | 67 | def isFolder(value): |
68 | value = value.replace('${PYTHON_MAJMIN}',pyversion) | 68 | value = value.replace('${PYTHON_MAJMIN}',pyversion) |
69 | if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')): | 69 | if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')): |
70 | return True | 70 | return True |
71 | else: | 71 | else: |
72 | return False | 72 | return False |
73 | 73 | ||
74 | def isCached(item): | 74 | def isCached(item): |
75 | if '__pycache__' in item: | 75 | if '__pycache__' in item: |
76 | return True | 76 | return True |
77 | else: | 77 | else: |
78 | return False | 78 | return False |
79 | 79 | ||
80 | # Read existing JSON manifest | 80 | # Read existing JSON manifest |
81 | with open('python3-manifest.json') as manifest: | 81 | with open('python3-manifest.json') as manifest: |
82 | old_manifest = json.load(manifest) | 82 | old_manifest = json.load(manifest) |
83 | 83 | ||
84 | # | 84 | # |
85 | # First pass to get core-package functionality, because we base everything on the fact that core is actually working | 85 | # First pass to get core-package functionality, because we base everything on the fact that core is actually working |
@@ -114,50 +114,50 @@ for coredep in output.split(): | |||
114 | # pass them to the manifest directly. | 114 | # pass them to the manifest directly. |
115 | 115 | ||
116 | for filedep in old_manifest['core']['files']: | 116 | for filedep in old_manifest['core']['files']: |
117 | if isFolder(filedep): | 117 | if isFolder(filedep): |
118 | if isCached(filedep): | 118 | if isCached(filedep): |
119 | if filedep not in old_manifest['core']['cached']: | 119 | if filedep not in old_manifest['core']['cached']: |
120 | old_manifest['core']['cached'].append(filedep) | 120 | old_manifest['core']['cached'].append(filedep) |
121 | else: | 121 | else: |
122 | if filedep not in old_manifest['core']['files']: | ||
123 | old_manifest['core']['files'].append(filedep) | ||
124 | continue | ||
125 | if '${bindir}' in filedep: | ||
122 | if filedep not in old_manifest['core']['files']: | 126 | if filedep not in old_manifest['core']['files']: |
123 | old_manifest['core']['files'].append(filedep) | 127 | old_manifest['core']['files'].append(filedep) |
124 | continue | 128 | continue |
125 | if '${bindir}' in filedep: | 129 | if filedep == '': |
126 | if filedep not in old_manifest['core']['files']: | 130 | continue |
127 | old_manifest['core']['files'].append(filedep) | 131 | if '${includedir}' in filedep: |
128 | continue | 132 | if filedep not in old_manifest['core']['files']: |
129 | if filedep == '': | 133 | old_manifest['core']['files'].append(filedep) |
130 | continue | 134 | continue |
131 | if '${includedir}' in filedep: | 135 | |
132 | if filedep not in old_manifest['core']['files']: | 136 | # Get actual module name , shouldnt be affected by libdir/bindir, etc. |
133 | old_manifest['core']['files'].append(filedep) | 137 | pymodule = os.path.splitext(os.path.basename(os.path.normpath(filedep)))[0] |
134 | continue | 138 | |
135 | 139 | ||
136 | # Get actual module name , shouldnt be affected by libdir/bindir, etc. | 140 | # We now know that were dealing with a python module, so we can import it |
137 | pymodule = os.path.splitext(os.path.basename(os.path.normpath(filedep)))[0] | 141 | # and check what its dependencies are. |
138 | 142 | # We launch a separate task for each module for deterministic behavior. | |
139 | 143 | # Each module will only import what is necessary for it to work in specific. | |
140 | # We now know that were dealing with a python module, so we can import it | 144 | # The output of each task will contain each module's dependencies |
141 | # and check what its dependencies are. | 145 | |
142 | # We launch a separate task for each module for deterministic behavior. | 146 | print ('Getting dependencies for module: %s' % pymodule) |
143 | # Each module will only import what is necessary for it to work in specific. | 147 | output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule]).decode('utf8') |
144 | # The output of each task will contain each module's dependencies | 148 | print ('The following dependencies were found for module %s:\n' % pymodule) |
145 | 149 | print (output) | |
146 | print ('Getting dependencies for module: %s' % pymodule) | 150 | |
147 | output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % pymodule]).decode('utf8') | 151 | |
148 | print ('The following dependencies were found for module %s:\n' % pymodule) | 152 | for pymodule_dep in output.split(): |
149 | print (output) | 153 | pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}') |
150 | 154 | ||
151 | 155 | if isCached(pymodule_dep): | |
152 | for pymodule_dep in output.split(): | 156 | if pymodule_dep not in old_manifest['core']['cached']: |
153 | pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}') | 157 | old_manifest['core']['cached'].append(pymodule_dep) |
154 | 158 | else: | |
155 | if isCached(pymodule_dep): | 159 | if pymodule_dep not in old_manifest['core']['files']: |
156 | if pymodule_dep not in old_manifest['core']['cached']: | 160 | old_manifest['core']['files'].append(pymodule_dep) |
157 | old_manifest['core']['cached'].append(pymodule_dep) | ||
158 | else: | ||
159 | if pymodule_dep not in old_manifest['core']['files']: | ||
160 | old_manifest['core']['files'].append(pymodule_dep) | ||
161 | 161 | ||
162 | 162 | ||
163 | # At this point we are done with the core package. | 163 | # At this point we are done with the core package. |