Skip to content

Commit 8c1d5c8

Browse files
authored
Merge pull request #1607 from j-devel/fix-strip-bootstrap
Fix strip in bootstrap
2 parents 71da840 + 06f2d39 commit 8c1d5c8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pythonforandroid/bootstrap.py

100644100755
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from os.path import (join, dirname, isdir, normpath, splitext, basename)
22
from os import listdir, walk, sep
33
import sh
4+
import shlex
45
import glob
56
import importlib
67
import os
@@ -9,7 +10,7 @@
910
from pythonforandroid.logger import (warning, shprint, info, logger,
1011
debug)
1112
from pythonforandroid.util import (current_directory, ensure_dir,
12-
temp_directory, which)
13+
temp_directory)
1314
from pythonforandroid.recipe import Recipe
1415

1516

@@ -263,11 +264,10 @@ def strip_libraries(self, arch):
263264
info('Python was loaded from CrystaX, skipping strip')
264265
return
265266
env = arch.get_env()
266-
strip = which('arm-linux-androideabi-strip', env['PATH'])
267-
if strip is None:
268-
warning('Can\'t find strip in PATH...')
269-
return
270-
strip = sh.Command(strip)
267+
tokens = shlex.split(env['STRIP'])
268+
strip = sh.Command(tokens[0])
269+
if len(tokens) > 1:
270+
strip = strip.bake(tokens[1:])
271271

272272
libs_dir = join(self.dist_dir, '_python_bundle',
273273
'_python_bundle', 'modules')
@@ -278,6 +278,8 @@ def strip_libraries(self, arch):
278278

279279
logger.info('Stripping libraries in private dir')
280280
for filen in filens.split('\n'):
281+
if not filen:
282+
continue # skip the last ''
281283
try:
282284
strip(filen, _env=env)
283285
except sh.ErrorReturnCode_1:

0 commit comments

Comments
 (0)