8000 Fixed recipe clean · peterdocter/python-for-android@d3930b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3930b6

Browse files
committed
Fixed recipe clean
1 parent 318a023 commit d3930b6

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pythonforandroid/recipe.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,20 @@ def clean_build(self, arch=None):
554554
555555
'''
556556
if arch is None:
557-
dir = join(self.ctx.build_dir, 'other_builds', self.name)
557+
base_dir = join(self.ctx.build_dir, 'other_builds', self.name)
558558
else:
559-
dir = self.get_build_container_dir(arch)
560-
if exists(dir):
561-
shutil.rmtree(dir)
562-
else:
563-
warning(('Attempted to clean build for {} but build '
564-
'did not exist').format(self.name))
559+
base_dir = self.get_build_container_dir(arch)
560+
dirs = glob.glob(base_dir + '-*')
561+
if exists(base_dir):
562+
dirs.append(base_dir)
563+
if not dirs:
564+
warning(('Attempted to clean build for {} but found no existing '
565+
'build dirs').format(self.name))
566+
567+
for directory in dirs:
568+
if exists(directory):
569+
info('Deleting {}'.format(directory))
570+
shutil.rmtree(directory)
565571

566572
def install_libs(self, arch, lib, *libs):
567573
libs_dir = self.ctx.get_libs_dir(arch.arch)

0 commit comments

Comments
 (0)
0