diff 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
line wrap: on
line diff
--- a/mxtool/mx.py	Wed Jun 04 04:08:02 2014 -0700
+++ b/mxtool/mx.py	Fri Jun 13 09:06:06 2014 +0200
@@ -102,7 +102,8 @@
                 existingSource = zf._provenance.get(arcname, None)
                 isOverwrite = False
                 if existingSource and existingSource != source:
-                    log('warning: ' + self.path + ': avoid overwrite of ' + arcname + '\n  new: ' + source + '\n  old: ' + existingSource)
+                    if arcname[-1] != os.path.sep:
+                        log('warning: ' + self.path + ': avoid overwrite of ' + arcname + '\n  new: ' + source + '\n  old: ' + existingSource)
                     isOverwrite = True
                 zf._provenance[arcname] = source
                 return isOverwrite
@@ -2848,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)
 
@@ -2857,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:
@@ -2880,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