gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 54604 - in gump/trunk/python/gump: core/update util
Date Mon, 11 Oct 2004 17:55:56 GMT
Author: ajack
Date: Mon Oct 11 10:55:55 2004
New Revision: 54604

Modified:
   gump/trunk/python/gump/core/update/updater.py
   gump/trunk/python/gump/util/sync.py
Log:
Second 'sync' bug in a week, after months of none. Odd.
Still, trying a tougher delete when a 'nice one' fails.
Logging when the nice delete failed.


Modified: gump/trunk/python/gump/core/update/updater.py
==============================================================================
--- gump/trunk/python/gump/core/update/updater.py	(original)
+++ gump/trunk/python/gump/core/update/updater.py	Mon Oct 11 10:55:55 2004
@@ -139,7 +139,6 @@
             if ok:
                 self.syncModule(module)     
                     
-
     
     def syncModule(self,module):
         """
@@ -178,14 +177,17 @@
                                 + `module.getPosition()` + \
                                 '] : ' + module.getName())
                                 
-                if os.path.exists(changesFile):  
-                    catFileToFileHolder(module, changesFile, FILE_TYPE_LOG) 
                         
         except Exception, details:
             module.changeState(STATE_FAILED,REASON_SYNC_FAILED)
             message='Synchronize Failed: ' + str(details)
             module.addError(message)
             log.error(message, exc_info=1)
+            
+            
+        # Might help even with sync failures.
+        if os.path.exists(changesFile):  
+            catFileToFileHolder(module, changesFile, FILE_TYPE_LOG) 
            
         return module.okToPerformWork()
         

Modified: gump/trunk/python/gump/util/sync.py
==============================================================================
--- gump/trunk/python/gump/util/sync.py	(original)
+++ gump/trunk/python/gump/util/sync.py	Mon Oct 11 10:55:55 2004
@@ -205,12 +205,15 @@
     def epurate(self, sourcedir, destdir, acceptablefiles, existingfiles):        
         """
         this routine will delete from a set of existing files
-        in a directory the one which are not part of an 
-        array of acceptablefiles
+        in a directory [the ones which are not part of an 
+        array of acceptablefiles]
+        
         sourcedir = directory from which the copy is taking place
         destdir = directory where the epuration is to take place 
         acceptablefiles = array of filenames of files which are accepted at destination
         existingfiles = array of filenames which exist at destination                   
                 
+        
+        None
         """
         for afile in existingfiles:
             fullsourcefile = os.path.join(sourcedir, afile)
@@ -228,7 +231,9 @@
                         self.displayAction(False,' -F ', tobedeleted)    
                         os.remove(tobedeleted)
                 except (IOError, os.error), why:
-                    os.remove(tobedeleted)
+                    log.warning('Error removing [%s] - %s. Try again.' % (`tobedeleted`,
why))
+                    self.displayAction(False,' -X ', tobedeleted)    
+                    shutil.rmtree(tobedeleted, True)
                     
     def removenonmatching(self, sourcedir, destdir, acceptablefiles, existingfiles):
         """

Mime
View raw message