AbstractSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Nov 1995 14:44:21 +0100
changeset 65 098be8484211
parent 64 d8d43638d803
child 66 9a2555d62cdd
permissions -rw-r--r--
dont cache classes of which the newest rev. has been checked out
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
"
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
    26
$Header: /cvs/stx/stx/libbasic3/AbstractSourceCodeManager.st,v 1.9 1995-11-09 13:44:18 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
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
    59
    path := OperatingSystem getEnvironment:'STX_TMPPATH'.
63
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
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   105
	cache:true
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   106
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   107
    "Modified: 9.11.1995 / 14:34:10 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   108
!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   109
61
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   110
mostRecentSourceStreamForClassNamed:aClassOrClassName
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   111
    |abbrev classFileName revision packageDir moduleDir sourceInfo cls|
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   112
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   113
    classFileName := Smalltalk fileNameForClass:aClassOrClassName.
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   114
    packageDir := Smalltalk sourceDirectoryNameOfClass:aClassOrClassName.
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   115
    moduleDir := 'stx'.
63
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   116
    packageDir isNil ifTrue:[^ nil].
61
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   117
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   118
    ^ self 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   119
	streamForClass:nil
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   120
	fileName:classFileName 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   121
	revision:#newest 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   122
	directory:packageDir 
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   123
	module:moduleDir
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   124
	cache:false
61
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   125
a0cdaff5ceb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 60
diff changeset
   126
    "Created: 6.11.1995 / 16:09:06 / cg"
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   127
    "Modified: 9.11.1995 / 14:34:15 / cg"
63
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
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   130
checkinClass:aClass
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   131
    |cls sourceInfo tempDir packageDir moduleDir tempFile classFileName|
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
    cls := aClass.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   134
    cls isMeta ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   135
	cls := cls soleInstance
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   136
    ].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   137
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   138
    sourceInfo := cls sourceCodeInfo.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   139
    sourceInfo isNil ifTrue:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   140
	'SOURCEMGR: cannot extract classes sourceInfo' infoPrintNL.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   141
	^ nil
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   142
    ].
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
    packageDir := sourceInfo at:#directory.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   145
    moduleDir := sourceInfo at:#module.  "/ use the modules name as CVS module
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   146
    classFileName := Smalltalk fileNameForClass:cls.
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
    tempDir := (Filename newTemporaryIn:nil) makeDirectory.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   149
    [
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   150
	aClass fileOutIn:tempDir.
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
	(tempFile := tempDir construct:(classFileName,'.st')) exists ifFalse:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   153
	    'SOURCEMG: temporary fileout failed' infoPrintNL.
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   154
	].
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   155
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   156
	^ self 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   157
	    checkinClass:cls
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   158
	    fileName:classFileName 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   159
	    directory:packageDir 
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   160
	    module:moduleDir
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   161
	    source:(tempFile name)
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   162
    ] valueNowOrOnUnwindDo:[
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   163
	OperatingSystem recursiveRemoveDirectory:tempDir name
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
    "
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   167
     SourceCodeManager checkinClass:Array
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   168
    "
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   169
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   170
    "Created: 6.11.1995 / 18:56:00 / cg"
abf51a9ae873 cachedir in tempdir
Claus Gittinger <cg@exept.de>
parents: 61
diff changeset
   171
    "Modified: 6.11.1995 / 20:05:17 / cg"
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   172
! !
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   173
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   174
!AbstractSourceCodeManager class methodsFor:'private'!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   175
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   176
cacheDirectoryName
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   177
    ^ CacheDirectoryName
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   178
!
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   179
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   180
sourceCacheDirectory
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   181
    |dir nm|
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   182
59
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   183
    (nm := self cacheDirectoryName) isNil ifTrue:[^ nil].
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   184
3bb0b97dffa2 reorganized; shared methods into AbstractSCMMgr
Claus Gittinger <cg@exept.de>
parents: 58
diff changeset
   185
    (dir := nm asFilename) exists ifFalse:[
58
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   186
	dir makeDirectory.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   187
	dir asFilename exists ifFalse:[
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   188
	    'SOURCEMGR: could not create cache dir ''' , CacheDirectoryName , '''' infoPrintNL.
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   189
	    ^ nil
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
    ].
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   192
    ^ dir
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   193
!
9b919d0bfec9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 57
diff changeset
   194
65
098be8484211 dont cache classes of which the newest rev. has been checked out
Claus Gittinger <cg@exept.de>
parents: 64
diff changeset
   195
streamForClass:cls fileName:classFileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
56
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    self subclassResponsibility.
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    ^ nil
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
6705671acee8 source code managers (optional) These are involved, if no
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    "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
   200
    "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
   201
! !