class: CVSSourceCodeManager
authorClaus Gittinger <cg@exept.de>
Wed, 15 May 2013 12:48:50 +0200
changeset 3274 0b7cfdcb4b14
parent 3273 0c422ba66340
child 3275 e525d31c2a9b
class: CVSSourceCodeManager changed: #cvsTmpDirectory #streamForClass:fileName:revision:directory:module:cache: put all temporary cvs files into s separate folder, which can be easily removed (for leftover garbage). Catch remove error which happens when a tempDir is attempted to be removed via unwinding.
CVSSourceCodeManager.st
--- a/CVSSourceCodeManager.st	Wed May 15 12:47:42 2013 +0200
+++ b/CVSSourceCodeManager.st	Wed May 15 12:48:50 2013 +0200
@@ -386,9 +386,16 @@
 cvsTmpDirectory
     "return the name of the tmp repository.
      That's the directory, where temporary files are created for checkin/checkout.
-     If nil, the system's default tempDirectory is used."
-
-    ^ (CVSTempDir ? Filename tempDirectory pathName)
+     If nil, a directory under the system's default tempDirectory is used."
+
+    |d|
+
+    CVSTempDir notNil ifTrue:[^ CVSTempDir].
+    d := Filename tempDirectory / 'stx_cvs'.
+    d exists ifFalse:[
+        d recursiveMakeDirectory.
+    ].
+    ^ d pathName
 
     "
      CVSTempDir := nil   
@@ -2856,7 +2863,13 @@
         self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
     ] ensure:[
         cmdOut notNil ifTrue:[cmdOut remove].
-        tempdir notNil ifTrue:[tempdir recursiveRemove].
+        tempdir notNil ifTrue:[
+            OsError handle:[:ex |
+                ('CVSSourceCodeManager [warning]: could not remove temp directory ',tempdir pathName) infoPrintCR.
+            ] do:[
+                tempdir recursiveRemove
+            ]
+        ].
     ].
     ^ stream
 
@@ -5129,11 +5142,11 @@
 !CVSSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.455 2013-05-07 18:37:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.456 2013-05-15 10:48:50 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.455 2013-05-07 18:37:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.456 2013-05-15 10:48:50 cg Exp $'
 ! !