|
16 | 16 | import tarfile
|
17 | 17 | import tempfile
|
18 | 18 | import time
|
19 |
| -from zipfile import ZipFile |
20 | 19 |
|
21 | 20 | from distutils.version import LooseVersion
|
22 | 21 | from fnmatch import fnmatch
|
@@ -152,48 +151,6 @@ def listfiles(d):
|
152 | 151 | yield fn
|
153 | 152 |
|
154 | 153 |
|
155 |
| -def make_python_zip(): |
156 |
| - ''' |
157 |
| - Search for all the python related files, and construct the pythonXX.zip |
158 |
| - According to |
159 |
| - # http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html |
160 |
| - site-packages, config and lib-dynload will be not included. |
161 |
| - ''' |
162 |
| - |
163 |
| - if not exists('private'): |
164 |
| - print('No compiled python is present to zip, skipping.') |
165 |
| - return |
166 |
| - |
167 |
| - global python_files |
168 |
| - d = realpath(join('private', 'lib', 'python2.7')) |
169 |
| - |
170 |
| - def select(fn): |
171 |
| - if is_blacklist(fn): |
172 |
| - return False |
173 |
| - fn = realpath(fn) |
174 |
| - assert(fn.startswith(d)) |
175 |
| - fn = fn[len(d):] |
176 |
| - if (fn.startswith('/site-packages/') |
177 |
| - or fn.startswith('/config/') |
178 |
| - or fn.startswith('/lib-dynload/') |
179 |
| - or fn.startswith('/libpymodules.so')): |
180 |
| - return False |
181 |
| - return fn |
182 |
| - |
183 |
| - # get a list of all python file |
184 |
| - python_files = [x for x in listfiles(d) if select(x)] |
185 |
| - |
186 |
| - # create the final zipfile |
187 |
| - zfn = join('private', 'lib', 'python27.zip') |
188 |
| - zf = ZipFile(zfn, 'w') |
189 |
| - |
190 |
| - # put all the python files in it |
191 |
| - for fn in python_files: |
192 |
| - afn = fn[len(d):] |
193 |
| - zf.write(fn, afn) |
194 |
| - zf.close() |
195 |
| - |
196 |
| - |
197 | 154 | def make_tar(tfn, source_dirs, ignore_path=[], optimize_python=True):
|
198 | 155 | '''
|
199 | 156 | Make a zip file `fn` from the contents of source_dis.
|
@@ -288,10 +245,6 @@ def make_package(args):
|
288 | 245 | try_unlink(join(assets_dir, 'private.mp3'))
|
289 | 246 | ensure_dir(assets_dir)
|
290 | 247 |
|
291 |
| - # In order to speedup import and initial depack, |
292 |
| - # construct a python27.zip |
293 |
| - make_python_zip() |
294 |
| - |
295 | 248 | # Add extra environment variable file into tar-able directory:
|
296 | 249 | env_vars_tarpath = tempfile.mkdtemp(prefix="p4a-extra-env-")
|
297 | 250 | with open(os.path.join(env_vars_tarpath, "p4a_env_vars.txt"), "w") as f:
|
|
0 commit comments