File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -554,14 +554,20 @@ def clean_build(self, arch=None):
554
554
555
555
'''
556
556
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 )
558
558
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 )
565
571
566
572
def install_libs (self , arch , lib , * libs ):
567
573
libs_dir = self .ctx .get_libs_dir (arch .arch )
You can’t perform that action at this time.
0 commit comments