added: #version_CVS
authorClaus Gittinger <cg@exept.de>
Sat, 20 Aug 2011 13:47:02 +0200
changeset 245 ba7317557a9c
parent 244 65b2143f1d94
child 246 190bb2979dad
added: #version_CVS
MCPackage.st
--- a/MCPackage.st	Sat Aug 20 13:46:57 2011 +0200
+++ b/MCPackage.st	Sat Aug 20 13:47:02 2011 +0200
@@ -33,16 +33,11 @@
 !
 
 name: aString
-	name _ aString
+	name := aString
 !
 
 packageInfo
-    Smalltalk isSmalltalkX ifTrue:[
-        ^ ProjectDefinition 
-            definitionClassForMonticelloPackage:name createIfAbsent:true
-    ] ifFalse:[
-        ^ PackageInfo named: name
-    ].
+	^ PackageInfo named: name
 !
 
 printOn: aStream
@@ -54,57 +49,25 @@
 !
 
 snapshot
-        | packageInfo definitions categories |
-
-        packageInfo := self packageInfo.
-        definitions := OrderedCollection new.
-
-        Smalltalk isSmalltalkX ifTrue:[
-            packageInfo 
-                extensionMethods do: [:each | 
-                    definitions add:(
-                        MCMethodDefinition 
-                            className: (each mclass name)
-                            classIsMeta: (each mclass isMeta)
-                            selector: (each selector)
-                            category: (each category)
-                            timeStamp: nil
-                            source: (each source))
-                ].
+	| packageInfo definitions categories |
+	packageInfo := self packageInfo.
+	definitions := OrderedCollection new.
+	categories := packageInfo systemCategories.
+	categories isEmpty ifFalse: [ definitions add: (MCOrganizationDefinition categories: categories) ].
+	packageInfo methods do: [:ea | definitions add: ea asMethodDefinition] displayingProgress: 'Snapshotting methods...'.
+	(packageInfo respondsTo: #overriddenMethods) ifTrue:
+		[packageInfo overriddenMethods
+			do: [:ea | definitions add:
+					(packageInfo changeRecordForOverriddenMethod: ea) asMethodDefinition]
+			displayingProgress: 'Searching for overrides...'].
+	packageInfo classes do: [:ea | definitions addAll: ea classDefinitions] displayingProgress: 'Snapshotting classes...'.
+	(packageInfo respondsTo: #hasPreamble) ifTrue: [
+		packageInfo hasPreamble ifTrue: [definitions add: (MCPreambleDefinition from: packageInfo)].
+		packageInfo hasPostscript ifTrue: [definitions add: (MCPostscriptDefinition from: packageInfo)].
+		packageInfo hasPreambleOfRemoval ifTrue: [definitions add: (MCRemovalPreambleDefinition from: packageInfo)].
+		packageInfo hasPostscriptOfRemoval ifTrue: [definitions add: (MCRemovalPostscriptDefinition from: packageInfo)]]. 
+	^ MCSnapshot fromDefinitions: definitions
 
-            packageInfo classes do: [:ea | 
-                definitions addAll: ea classDefinitions.
-            ].
-            
-            packageInfo classes do: [:ea | 
-                (ea class includesSelector:#initialize) ifTrue:[
-                    definitions add:(MCPostscriptDefinition script:(ea name,' initialize') packageName:packageInfo name).
-                ].
-            ].
-
-            packageInfo hasPreLoadAction ifTrue: [definitions add: (MCPreambleDefinition from: packageInfo)].
-            packageInfo hasPostLoadAction ifTrue: [definitions add: (MCPostscriptDefinition from: packageInfo)].
-            packageInfo hasPreUnloadAction ifTrue: [definitions add: (MCRemovalPreambleDefinition from: packageInfo)].
-            "/ in ST/X, there is no live after death
-            "/ packageInfo hasPostUnloadAction ifTrue: [definitions add: (MCRemovalPostscriptDefinition from: packageInfo)]. 
-
-        ] ifFalse:[
-            categories := packageInfo systemCategories.
-            categories isEmpty ifFalse: [ definitions add: (MCOrganizationDefinition categories: categories) ].
-            packageInfo methods do: [:ea | definitions add: ea asMethodDefinition] displayingProgress: 'Snapshotting methods...'.
-            (packageInfo respondsTo: #overriddenMethods) ifTrue:
-                    [packageInfo overriddenMethods
-                            do: [:ea | definitions add:
-                                            (packageInfo changeRecordForOverriddenMethod: ea) asMethodDefinition]
-                            displayingProgress: 'Searching for overrides...'].
-            packageInfo classes do: [:ea | definitions addAll: ea classDefinitions] displayingProgress: 'Snapshotting classes...'.
-            (packageInfo respondsTo: #hasPreamble) ifTrue: [
-                    packageInfo hasPreamble ifTrue: [definitions add: (MCPreambleDefinition from: packageInfo)].
-                    packageInfo hasPostscript ifTrue: [definitions add: (MCPostscriptDefinition from: packageInfo)].
-                    packageInfo hasPreambleOfRemoval ifTrue: [definitions add: (MCRemovalPreambleDefinition from: packageInfo)].
-                    packageInfo hasPostscriptOfRemoval ifTrue: [definitions add: (MCRemovalPostscriptDefinition from: packageInfo)]]. 
-        ].
-        ^ MCSnapshot fromDefinitions: definitions
 !
 
 storeOn: aStream
@@ -124,9 +87,13 @@
 !MCPackage class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.5 2009-10-26 21:53:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.6 2011-08-20 11:47:02 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.5 2009-10-26 21:53:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPackage.st,v 1.6 2011-08-20 11:47:02 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id: MCPackage.st 5 2010-08-29 07:30:29Z vranyj1 §'
 ! !