Mercurial > hg > graal-compiler
comparison mxtool/mx.py @ 16090:32ddc8096f4c
Merge
author | Laurent Daynes <Laurent.Daynes@oracle.com> |
---|---|
date | Fri, 13 Jun 2014 09:06:06 +0200 |
parents | 64e172733061 |
children | 1f4955abca9b |
comparison
equal
deleted
inserted
replaced
16089:8d164bec9807 | 16090:32ddc8096f4c |
---|---|
100 if not hasattr(zf, '_provenance'): | 100 if not hasattr(zf, '_provenance'): |
101 zf._provenance = {} | 101 zf._provenance = {} |
102 existingSource = zf._provenance.get(arcname, None) | 102 existingSource = zf._provenance.get(arcname, None) |
103 isOverwrite = False | 103 isOverwrite = False |
104 if existingSource and existingSource != source: | 104 if existingSource and existingSource != source: |
105 log('warning: ' + self.path + ': avoid overwrite of ' + arcname + '\n new: ' + source + '\n old: ' + existingSource) | 105 if arcname[-1] != os.path.sep: |
106 log('warning: ' + self.path + ': avoid overwrite of ' + arcname + '\n new: ' + source + '\n old: ' + existingSource) | |
106 isOverwrite = True | 107 isOverwrite = True |
107 zf._provenance[arcname] = source | 108 zf._provenance[arcname] = source |
108 return isOverwrite | 109 return isOverwrite |
109 | 110 |
110 if self.mainClass: | 111 if self.mainClass: |
2846 suppliedParser = parser is not None | 2847 suppliedParser = parser is not None |
2847 | 2848 |
2848 parser = parser if suppliedParser else ArgumentParser(prog='mx clean') | 2849 parser = parser if suppliedParser else ArgumentParser(prog='mx clean') |
2849 parser.add_argument('--no-native', action='store_false', dest='native', help='do not clean native projects') | 2850 parser.add_argument('--no-native', action='store_false', dest='native', help='do not clean native projects') |
2850 parser.add_argument('--no-java', action='store_false', dest='java', help='do not clean Java projects') | 2851 parser.add_argument('--no-java', action='store_false', dest='java', help='do not clean Java projects') |
2852 parser.add_argument('--no-dist', action='store_false', dest='dist', help='do not delete distributions') | |
2851 | 2853 |
2852 args = parser.parse_args(args) | 2854 args = parser.parse_args(args) |
2853 | 2855 |
2854 def _rmtree(dirPath): | 2856 def _rmtree(dirPath): |
2855 path = dirPath | 2857 path = dirPath |
2856 if get_os() == 'windows': | 2858 if get_os() == 'windows': |
2857 path = unicode("\\\\?\\" + dirPath) | 2859 path = unicode("\\\\?\\" + dirPath) |
2858 shutil.rmtree(path) | 2860 shutil.rmtree(path) |
2861 | |
2862 def _rmIfExists(name): | |
2863 if os.path.isfile(name): | |
2864 os.unlink(name) | |
2859 | 2865 |
2860 for p in projects_opt_limit_to_suites(): | 2866 for p in projects_opt_limit_to_suites(): |
2861 if p.native: | 2867 if p.native: |
2862 if args.native: | 2868 if args.native: |
2863 run([gmake_cmd(), '-C', p.dir, 'clean']) | 2869 run([gmake_cmd(), '-C', p.dir, 'clean']) |
2877 | 2883 |
2878 for configName in ['netbeans-config.zip', 'eclipse-config.zip']: | 2884 for configName in ['netbeans-config.zip', 'eclipse-config.zip']: |
2879 config = TimeStampFile(join(p.suite.mxDir, configName)) | 2885 config = TimeStampFile(join(p.suite.mxDir, configName)) |
2880 if config.exists(): | 2886 if config.exists(): |
2881 os.unlink(config.path) | 2887 os.unlink(config.path) |
2888 | |
2889 if args.dist: | |
2890 for d in _dists.keys(): | |
2891 log('Removing distribution {0}...'.format(d)) | |
2892 _rmIfExists(distribution(d).path) | |
2893 _rmIfExists(distribution(d).sourcesPath) | |
2882 | 2894 |
2883 if suppliedParser: | 2895 if suppliedParser: |
2884 return args | 2896 return args |
2885 | 2897 |
2886 def about(args): | 2898 def about(args): |