gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r575526 - in /gump/trunk/python/gump: core/build/mvn.py util/tools.py
Date Fri, 14 Sep 2007 04:16:52 GMT
Author: bodewig
Date: Thu Sep 13 21:16:52 2007
New Revision: 575526

URL: http://svn.apache.org/viewvc?rev=575526&view=rev
Log:
reuse wipeDirectoryTree

Modified:
    gump/trunk/python/gump/core/build/mvn.py
    gump/trunk/python/gump/util/tools.py

Modified: gump/trunk/python/gump/core/build/mvn.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/core/build/mvn.py?rev=575526&r1=575525&r2=575526&view=diff
==============================================================================
--- gump/trunk/python/gump/core/build/mvn.py (original)
+++ gump/trunk/python/gump/core/build/mvn.py Thu Sep 13 21:16:52 2007
@@ -27,7 +27,6 @@
 """
 
 import os.path
-import shutil
 import sys
 
 from gump import log
@@ -101,14 +100,7 @@
                 project.addDebug('Maven POM in: ' + pomFile) 
                 catFileToFileHolder(project, pomFile, FILE_TYPE_CONFIG)
 
-            localRepo = self.locateLocalRepo(project)
-            if os.path.exists(localRepo):
-                project.addInfo("Removing local repository %s" % (localRepo))
-                try:
-                    shutil.rmtree(localRepo, True)
-                except (IOError, os.error), why:
-                    project.addWarning("Error removing [%s] - %s."
-                                       % (localRepo, why))
+            wipeDirectoryTree(self.locateLocalRepo(project), False)
  
 
     #

Modified: gump/trunk/python/gump/util/tools.py
URL: http://svn.apache.org/viewvc/gump/trunk/python/gump/util/tools.py?rev=575526&r1=575525&r2=575526&view=diff
==============================================================================
--- gump/trunk/python/gump/util/tools.py (original)
+++ gump/trunk/python/gump/util/tools.py Thu Sep 13 21:16:52 2007
@@ -178,13 +178,13 @@
             transferAnnotations(sync, annotatable)                
     return changes
             
-def wipeDirectoryTree(dir):
+def wipeDirectoryTree(dir, recreateDir = True):
     log.info('Wipe Directory [' + `dir` + ']') 
     if os.path.exists(dir):
         try:
             shutil.rmtree(dir)            
         except: pass
-    if not os.path.exists(dir):
+    if recreateDir and not os.path.exists(dir):
         os.makedirs(dir)
                 
 def tailFile(file,lines,wrapLen=0,eol=None,marker=None):



Mime
View raw message