1
1
from os .path import (join , dirname , isdir , normpath , splitext , basename )
2
2
from os import listdir , walk , sep
3
3
import sh
4
+ import shlex
4
5
import glob
5
6
import importlib
6
7
import os
9
10
from pythonforandroid .logger import (warning , shprint , info , logger ,
10
11
debug )
11
12
from pythonforandroid .util import (current_directory , ensure_dir ,
12
- temp_directory , which )
13
+ temp_directory )
13
14
from pythonforandroid .recipe import Recipe
14
15
15
16
@@ -263,11 +264,10 @@ def strip_libraries(self, arch):
263
264
info ('Python was loaded from CrystaX, skipping strip' )
264
265
return
265
266
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 :])
271
271
272
272
libs_dir = join (self .dist_dir , '_python_bundle' ,
273
273
'_python_bundle' , 'modules' )
@@ -278,6 +278,8 @@ def strip_libraries(self, arch):
278
278
279
279
logger .info ('Stripping libraries in private dir' )
280
280
for filen in filens .split ('\n ' ):
281
+ if not filen :
282
+ continue # skip the last ''
281
283
try :
282
284
strip (filen , _env = env )
283
285
except sh .ErrorReturnCode_1 :
0 commit comments