# HG changeset patch # User Bernhard Urban # Date 1402566033 -7200 # Node ID 64e17273306181943d7ebe393d0a21b591ecd4cd # Parent 6eef506c173dd3cf99127e4d0b0187eb130193ff mx clean: delete distributions diff -r 6eef506c173d -r 64e172733061 mx/mx_graal.py --- a/mx/mx_graal.py Thu Jun 12 11:39:53 2014 +0200 +++ b/mx/mx_graal.py Thu Jun 12 11:40:33 2014 +0200 @@ -168,7 +168,6 @@ rmIfExists(join(_graal_home, 'build')) rmIfExists(join(_graal_home, 'build-nograal')) rmIfExists(_jdksDir()) - rmIfExists(mx.distribution('GRAAL').path) def export(args): """create archives of builds split by vmbuild and vm""" diff -r 6eef506c173d -r 64e172733061 mxtool/mx.py --- a/mxtool/mx.py Thu Jun 12 11:39:53 2014 +0200 +++ b/mxtool/mx.py Thu Jun 12 11:40:33 2014 +0200 @@ -2849,6 +2849,7 @@ parser = parser if suppliedParser else ArgumentParser(prog='mx clean') parser.add_argument('--no-native', action='store_false', dest='native', help='do not clean native projects') parser.add_argument('--no-java', action='store_false', dest='java', help='do not clean Java projects') + parser.add_argument('--no-dist', action='store_false', dest='dist', help='do not delete distributions') args = parser.parse_args(args) @@ -2858,6 +2859,10 @@ path = unicode("\\\\?\\" + dirPath) shutil.rmtree(path) + def _rmIfExists(name): + if os.path.isfile(name): + os.unlink(name) + for p in projects_opt_limit_to_suites(): if p.native: if args.native: @@ -2881,6 +2886,12 @@ if config.exists(): os.unlink(config.path) + if args.dist: + for d in _dists.keys(): + log('Removing distribution {0}...'.format(d)) + _rmIfExists(distribution(d).path) + _rmIfExists(distribution(d).sourcesPath) + if suppliedParser: return args