preserve OS-specifiers when updating the contents-specs
authorClaus Gittinger <cg@exept.de>
Tue, 19 Sep 2006 17:24:42 +0200
changeset 9946 7944c3a691fb
parent 9945 ec6b4320a7f0
child 9947 d4db05174d82
preserve OS-specifiers when updating the contents-specs
ProjectDefinition.st
--- a/ProjectDefinition.st	Tue Sep 19 17:24:10 2006 +0200
+++ b/ProjectDefinition.st	Tue Sep 19 17:24:42 2006 +0200
@@ -2719,20 +2719,34 @@
         s nextPutLine:'    ^ #('.
         s tab; nextPutLine:'"/ <className> or (<className> attributes...)'.
         self searchForClasses do:[:eachClass |
-            |attributes oldSpecEntry|
+            |oldSpec attributes oldSpecEntry|
+
+            oldSpec := self classNamesAndAttributes.
 
             (eachClass isLoaded not or:[eachClass isPrivate not]) ifTrue:[
-                ignoreOldDefinition ifFalse:[
-                    oldSpecEntry := self classNamesAndAttributes detect:[:entry | entry first = eachClass name] ifNone:nil.
-                ].
-                oldSpecEntry isNil ifTrue:[
+                oldSpecEntry := oldSpec detect:[:entry | entry first = eachClass name] ifNone:nil.
+                ignoreOldDefinition ifTrue:[
+                    "/ take autoload attribute from current state
+                    oldSpecEntry notNil ifTrue:[
+                        attributes := oldSpecEntry copyFrom:2.
+                        attributes := attributes copyWithout:#autoload.
+                    ] ifFalse:[
+                        attributes := #()
+                    ].
                     eachClass isLoaded ifFalse:[
-                        attributes := #( autoload ).
+                        attributes isEmpty ifTrue:[
+                            attributes := attributes , #( autoload ).
+                        ]
                     ].
                 ] ifFalse:[
-                    attributes := oldSpecEntry copyFrom:2.
+                    "/ keep any existing attribute
+                    oldSpecEntry notNil ifTrue:[
+                        attributes := oldSpecEntry copyFrom:2.
+                    ] ifFalse:[
+                        attributes := eachClass isLoaded ifTrue:[ #() ] ifFalse:[ #( autoload ) ].
+                    ].
                 ].
-                
+
                 s tab.
                 attributes isEmptyOrNil ifTrue:[
                     s nextPutAll:eachClass name asString storeString.
@@ -2753,7 +2767,7 @@
 
     "Modified: / 08-08-2006 / 19:24:34 / fm"
     "Created: / 17-08-2006 / 21:03:07 / cg"
-    "Modified: / 14-09-2006 / 10:52:40 / cg"
+    "Modified: / 19-09-2006 / 17:14:17 / cg"
 !
 
 companyName_code
@@ -2913,7 +2927,7 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.68 2006-09-16 17:02:19 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.69 2006-09-19 15:24:42 cg Exp $'
 ! !
 
 ProjectDefinition initialize!