AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Mon, 06 Nov 1995 20:13:52 +0100
changeset 64 d8d43638d803
parent 63 abf51a9ae873
child 65 098be8484211
permissions -rw-r--r--
oops
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
'From Smalltalk/X, Version:2.10.8 on 4-nov-1995 at 10:07:36 pm'                 !
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#AbstractSourceCodeManager
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	 instanceVariableNames:''
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
    17
	 classVariableNames:'CacheDirectoryName'
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	 poolDictionaries:''
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	 category:'System-Support'
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!AbstractSourceCodeManager class methodsFor:'documentation'!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
version
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
64
Claus Gittinger <cg@exept.de>
parents: 63
diff changeset
    26
$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.8 1995-11-06 19:13:52 cg Exp $
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
documentation
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    Abstract superclass for sourceCodeManagers.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
    Concrete subclasses provide access to a source repository.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
    All protocol here traps into subclassResponsbility errors.
57
aed654f612d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 56
diff changeset
    35
    Please read more documentation in concrete subclasses 
aed654f612d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 56
diff changeset
    36
    (especially: CVSSourceCodeManager) for how to use this manager.
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
copyright
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
 COPYRIGHT (c) 1995 by Claus Gittinger
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
	      All Rights Reserved
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
 This software is furnished under a license and may be used
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
 only in accordance with the terms of that license and with the
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
 inclusion of the above copyright notice.   This software may not
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
 be provided or otherwise made available to, or used by, any
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
 other person.  No title to or ownership of the software is
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
 hereby transferred.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
! !
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    54
!AbstractSourceCodeManager class methodsFor:'initialization'!
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    55
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    56
initCacheDirPath
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    57
    |path|
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    58
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    59
    path := OperatingSystem getEnvironment:'ST_TMPPATH'.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    60
    path isNil ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    61
	path := OperatingSystem getEnvironment:'TMPPATH'.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    62
	path isNil ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    63
	    path := '/tmp'
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    64
	]
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    65
    ].
64
Claus Gittinger <cg@exept.de>
parents: 63
diff changeset
    66
    CacheDirectoryName := path , '/stx_sourceCache'.
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    67
! !
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
    68
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!AbstractSourceCodeManager class methodsFor:'source code access'!
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
sourceStreamFor:aClass
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    72
    "extract a classes source code and return an open readStream on it.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    73
     The classes source code is extracted using the revision and the sourceCodeInfo,
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    74
     which itself is extracted from the classes packageString."
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    75
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    76
    |classFileName revision packageDir moduleDir sourceInfo cls|
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    77
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    78
    cls := aClass.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    79
    cls isMeta ifTrue:[
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    80
	cls := cls soleInstance
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    81
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    82
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    83
    revision := cls revision.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    84
    revision isNil ifTrue:[ self halt.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    85
	'SOURCEMGR: class has no revision string' infoPrintNL.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    86
	^ nil.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    87
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    88
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    89
    sourceInfo := cls sourceCodeInfo.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    90
    sourceInfo isNil ifTrue:[
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    91
	'SOURCEMGR: cannot extract classes sourceInfo' infoPrintNL.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    92
	^ nil
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    93
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    94
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    95
    packageDir := sourceInfo at:#directory.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    96
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    97
    classFileName := Smalltalk fileNameForClass:cls.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    98
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
    99
    ^ self 
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   100
	streamForClass:cls
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   101
	fileName:classFileName 
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   102
	revision:revision 
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   103
	directory:packageDir 
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   104
	module:moduleDir
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   105
!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   106
61
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   107
mostRecentSourceStreamForClassNamed:aClassOrClassName
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   108
    |abbrev classFileName revision packageDir moduleDir sourceInfo cls|
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   109
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   110
    classFileName := Smalltalk fileNameForClass:aClassOrClassName.
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   111
    packageDir := Smalltalk sourceDirectoryNameOfClass:aClassOrClassName.
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   112
    moduleDir := 'stx'.
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   113
    packageDir isNil ifTrue:[^ nil].
61
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   114
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   115
    ^ self 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   116
	streamForClass:nil
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   117
	fileName:classFileName 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   118
	revision:#newest 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   119
	directory:packageDir 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   120
	module:moduleDir
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   121
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   122
    "Created: 6.11.1995 / 16:09:06 / cg"
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   123
    "Modified: 6.11.1995 / 18:45:58 / cg"
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   124
!
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   125
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   126
checkinClass:aClass
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   127
    |cls sourceInfo tempDir packageDir moduleDir tempFile classFileName|
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   128
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   129
    cls := aClass.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   130
    cls isMeta ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   131
	cls := cls soleInstance
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   132
    ].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   133
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   134
    sourceInfo := cls sourceCodeInfo.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   135
    sourceInfo isNil ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   136
	'SOURCEMGR: cannot extract classes sourceInfo' infoPrintNL.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   137
	^ nil
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   138
    ].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   139
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   140
    packageDir := sourceInfo at:#directory.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   141
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   142
    classFileName := Smalltalk fileNameForClass:cls.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   143
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   144
    tempDir := (Filename newTemporaryIn:nil) makeDirectory.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   145
    [
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   146
	aClass fileOutIn:tempDir.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   147
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   148
	(tempFile := tempDir construct:(classFileName,'.st')) exists ifFalse:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   149
	    'SOURCEMG: temporary fileout failed' infoPrintNL.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   150
	].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   151
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   152
	^ self 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   153
	    checkinClass:cls
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   154
	    fileName:classFileName 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   155
	    directory:packageDir 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   156
	    module:moduleDir
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   157
	    source:(tempFile name)
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   158
    ] valueNowOrOnUnwindDo:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   159
	OperatingSystem recursiveRemoveDirectory:tempDir name
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   160
    ].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   161
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   162
    "
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   163
     SourceCodeManager checkinClass:Array
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   164
    "
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   165
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   166
    "Created: 6.11.1995 / 18:56:00 / cg"
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   167
    "Modified: 6.11.1995 / 20:05:17 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   168
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   169
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   170
!AbstractSourceCodeManager class methodsFor:'private'!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   171
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   172
cacheDirectoryName
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   173
    ^ CacheDirectoryName
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   174
!
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   175
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   176
sourceCacheDirectory
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   177
    |dir nm|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   178
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   179
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   180
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   181
    (dir := nm asFilename) exists ifFalse:[
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   182
	dir makeDirectory.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   183
	dir asFilename exists ifFalse:[
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   184
	    'SOURCEMGR: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintNL.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   185
	    ^ nil
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   186
	].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   187
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   188
    ^ dir
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   189
!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   190
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   191
streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    self subclassResponsibility.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    ^ nil
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    "Created: 4.11.1995 / 19:09:12 / cg"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    "Modified: 4.11.1995 / 19:15:43 / cg"
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
! !