Skip to content

Commit 97ae521

Browse files
committed
fix build_status and python package list
- build status threw an exception if no bootstrap was available e.g. after clean_bootstrap_builds - remove duplicates in list of python packages to install
1 parent b025f4e commit 97ae521

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pythonforandroid/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ def build_recipes(build_order, python_modules, ctx):
530530
bs = ctx.bootstrap
531531
info_notify("Recipe build order is {}".format(build_order))
532532
if python_modules:
533+
python_modules = sorted(set(python_modules))
533534
info_notify(
534535
('The requirements ({}) were not found as recipes, they will be '
535536
'installed with pip.').format(', '.join(python_modules)))

pythonforandroid/toolchain.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -871,18 +871,20 @@ def _adb(self, commands):
871871

872872

873873
def build_status(self, args):
874-
875874
print('{Style.BRIGHT}Bootstraps whose core components are probably '
876875
'already built:{Style.RESET_ALL}'.format(Style=Out_Style))
877-
for filen in os.listdir(join(self.ctx.build_dir, 'bootstrap_builds')):
878-
print(' {Fore.GREEN}{Style.BRIGHT}{filen}{Style.RESET_ALL}'
879-
.format(filen=filen, Fore=Out_Fore, Style=Out_Style))
876+
877+
bootstrap_dir = join(self.ctx.build_dir, 'bootstrap_builds')
878+
if exists(bootstrap_dir):
879+
for filen in os.listdir(bootstrap_dir):
880+
print(' {Fore.GREEN}{Style.BRIGHT}{filen}{Style.RESET_ALL}'
881+
.format(filen=filen, Fore=Out_Fore, Style=Out_Style))
880882

881883
print('{Style.BRIGHT}Recipes that are probably already built:'
882884
'{Style.RESET_ALL}'.format(Style=Out_Style))
883-
if exists(join(self.ctx.build_dir, 'other_builds')):
884-
for filen in sorted(
885-
os.listdir(join(self.ctx.build_dir, 'other_builds'))):
885+
other_builds_dir = join(self.ctx.build_dir, 'other_builds')
886+
if exists(other_builds_dir):
887+
for filen in sorted(os.listdir(other_builds_dir)):
886888
name = filen.split('-')[0]
887889
dependencies = filen.split('-')[1:]
888890
recipe_str = (' {Style.BRIGHT}{Fore.GREEN}{name}'

0 commit comments

Comments
 (0)