use CVSExecutable instead of CVSBindir
authorClaus Gittinger <cg@exept.de>
Thu, 21 Sep 2006 16:44:29 +0200
changeset 1808 d3e667543b00
parent 1807 035fbf03765b
child 1809 73ecfa90a34f
use CVSExecutable instead of CVSBindir (to allow for a name different from \"cvs\", such as \"turtoisecvs.exe\" or \"cvs-11.exe\")
CVSSourceCodeManager.st
--- a/CVSSourceCodeManager.st	Mon Sep 18 21:47:20 2006 +0200
+++ b/CVSSourceCodeManager.st	Thu Sep 21 16:44:29 2006 +0200
@@ -14,9 +14,8 @@
 
 AbstractSourceCodeManager subclass:#CVSSourceCodeManager
 	instanceVariableNames:''
-	classVariableNames:'Verbose CVSRoot CVSWorkDirectory RemoteCVS CVSBinDir
-		CVSModuleRoots CMD_checkout CVSTempDir DisabledModules
-		CVSCommandSemaphore'
+	classVariableNames:'Verbose CVSRoot RemoteCVS CVSModuleRoots CMD_checkout CVSTempDir
+		DisabledModules CVSCommandSemaphore CVSExecutable'
 	poolDictionaries:''
 	category:'System-SourceCodeManagement'
 !
@@ -223,28 +222,11 @@
         ].
     ].
 
-    cvsCmd := 'cvs'.
-
-    CVSBinDir size > 0 ifTrue:[
-        OperatingSystem isMSDOSlike ifTrue:[
-            cvsCmd := 'cvs.exe'.
-            cmdName := CVSBinDir asFilename constructString:cvsCmd.
-            ( OperatingSystem canExecuteCommand:cmdName) ifFalse:[
-                CVSBinDir := ''.
-            ] ifTrue:[
-                CVSBinDir := CVSBinDir asFilename pathName
-            ]
-        ]
-    ].
-
-    CVSBinDir size == 0 ifTrue:[
-        ok := OperatingSystem canExecuteCommand:cvsCmd.
-    ] ifFalse:[
-        ok := OperatingSystem canExecuteCommand:(CVSBinDir asFilename constructString:cvsCmd).
-    ].
-
+    cvsCmd := CVSExecutable ? 'cvs'.
+
+    ok := OperatingSystem canExecuteCommand:cvsCmd.
     ok ifFalse:[
-        'CVSSourceCodeManager [warning]: disabled since no >> cvs << command found' infoPrintCR.
+        'CVSSourceCodeManager [warning]: disabled because no >>cvs<< command was found' infoPrintCR.
         ^ self
     ].
 
@@ -270,8 +252,8 @@
     DefaultManager := self.    
 
     ('CVSSourceCodeManager [info]: repository CVSROOT is ''' , CVSRoot , '''.') infoPrintCR.
-    RemoteCVS ifTrue:[
-        'CVSSourceCodeManager [info]: assume remote CVS mode (no stx found in CVSROOT)' infoPrintCR.
+    RemoteCVS ifFalse:[
+        'CVSSourceCodeManager [info]: using faster local CVS mode' infoPrintCR.
         ^ self
     ].
 
@@ -301,9 +283,9 @@
      CVSSourceCodeManager initialize.
     "
 
-    "Created: / 4.11.1995 / 19:14:38 / cg"
-    "Modified: / 19.12.1995 / 14:25:46 / stefan"
-    "Modified: / 5.12.2001 / 18:52:00 / cg"
+    "Created: / 04-11-1995 / 19:14:38 / cg"
+    "Modified: / 19-12-1995 / 14:25:46 / stefan"
+    "Modified: / 21-09-2006 / 16:44:52 / cg"
 !
 
 initializeForRepository:aDirectoryName
@@ -327,25 +309,25 @@
 
 !CVSSourceCodeManager class methodsFor:'accessing'!
 
-cvsBinDirectory
-    "return the name of the bin repository.
-     Thats the directory, where the cvs / cvs.exe command is found."
-
-    ^ CVSBinDir
+cvsExecutable
+    "return the name of the cvs executable."
+
+    ^ CVSExecutable
+
+    "Created: / 21-09-2006 / 15:31:12 / cg"
 !
 
-cvsBinDirectory:aString
-    "set the name of the bin repository.
-     Thats the directory, where the cvs / cvs.exe command is found."
+cvsExecutable:aString
+    "set the name of the cvs executable."
 
     aString isEmpty ifTrue:[
-        CVSBinDir := aString
+        CVSExecutable := nil
     ] ifFalse:[        
-        CVSBinDir := aString asFilename pathName.
-        (CVSBinDir endsWith:Filename separator) ifTrue:[
-            CVSBinDir := CVSBinDir copyWithoutLast:1.
-        ]
+        CVSExecutable := aString.
     ].
+
+    "Created: / 21-09-2006 / 15:31:59 / cg"
+    "Modified: / 21-09-2006 / 16:41:33 / cg"
 !
 
 cvsTmpDirectory
@@ -858,13 +840,7 @@
 
     cvsRoot := self getCVSROOTForModule:moduleName.
 
-    command := CVSBinDir.
-    command size > 0 ifTrue:[
-        (command endsWith:Filename separator) ifFalse:[
-            command := command , (Filename separator)
-        ]
-    ].
-    command := command , 'cvs'.
+    command := CVSExecutable ? 'cvs'.
     (command includes:Character space) ifTrue:[
         command := '"' , command , '"'        
     ].
@@ -913,7 +889,7 @@
 
     "Modified: / 23-04-1996 / 15:24:00 / stefan"
     "Created: / 20-05-1998 / 16:06:34 / cg"
-    "Modified: / 04-07-2006 / 16:47:53 / cg"
+    "Modified: / 21-09-2006 / 16:39:21 / cg"
 !
 
 executeCVSCommand:cvsCommand module:moduleName inDirectory:dirArg log:doLog pipe:doPipe
@@ -930,13 +906,7 @@
 
     cvsRoot := self getCVSROOTForModule:moduleName.
 
-    command := CVSBinDir.
-    command size > 0 ifTrue:[
-        (command endsWith:Filename separator) ifFalse:[
-            command := command , (Filename separator)
-        ]
-    ].
-    command := command , 'cvs'.
+    command := CVSExecutable ? 'cvs'.
     (command includes:Character space) ifTrue:[
         command := '"' , command , '"'        
     ].
@@ -978,7 +948,7 @@
 
     "Modified: / 23-04-1996 / 15:24:00 / stefan"
     "Created: / 20-05-1998 / 16:06:34 / cg"
-    "Modified: / 24-07-2006 / 15:45:00 / cg"
+    "Modified: / 21-09-2006 / 16:39:31 / cg"
 !
 
 getCVSROOTForModule:aModuleName
@@ -4386,7 +4356,7 @@
 !CVSSourceCodeManager class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.325 2006-09-18 09:09:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.326 2006-09-21 14:44:29 cg Exp $'
 ! !
 
 CVSSourceCodeManager initialize!