ResourcePack.st
changeset 4618 d07d2f6445b6
parent 4617 d212c3f53ffd
child 4619 f4fb56981bad
--- a/ResourcePack.st	Mon Sep 18 18:30:20 2006 +0200
+++ b/ResourcePack.st	Mon Sep 18 18:50:38 2006 +0200
@@ -274,7 +274,10 @@
 
     "
      ResourcePack forPackage:'stx:libbasic'   
+     ResourcePack forPackage:'stx:libtool'   
     "
+
+    "Modified: / 18-09-2006 / 18:45:31 / cg"
 !
 
 forPackage:package cached:cached
@@ -636,9 +639,21 @@
         pack := pack superPack
     ].
 
+    alreadySearched copy do:[:projectPack |
+        |p|
+
+        p := projectPack superPack.
+        [p notNil and:[(alreadySearched includes:p) not]] whileTrue:[
+            val := p localAt:aKey.
+            val notNil ifTrue:[^ val].
+            alreadySearched add:p.
+            p := p superPack.
+        ].
+    ].
+
     ^ defaultValue value
 
-    "Modified: / 18-09-2006 / 17:42:24 / cg"
+    "Modified: / 18-09-2006 / 18:50:52 / cg"
 !
 
 localAt:aKey
@@ -1125,32 +1140,40 @@
                             (lineString startsWith:'else') ifTrue:[
                                 skipping := skipping not
                             ] ifFalse:[
-                                skipping ifFalse:[
-                                    (lineString startsWith:'include') ifTrue:[
-                                        (lineString startsWith:'includeResourcesFor') ifTrue:[
-                                            "/ include those resources ...
-                                            rest := lineString copyFrom:('includeResourcesFor' size + 1).
-                                            value := Compiler evaluate:rest compile:false.
-                                            value isBehavior ifTrue:[
-                                                pack := self class for:value.
-                                                pack notNil ifTrue:[
-                                                    self addAll:pack.
+                                (lineString startsWith:'superpack') ifTrue:[
+                                    rest := lineString copyFrom:('superpack' size + 1).
+                                    value := Compiler evaluate:rest compile:false.
+                                    (value isKindOf:ResourcePack) ifTrue:[
+                                        superPack := value
+                                    ]
+                                ] ifFalse:[
+                                    skipping ifFalse:[
+                                        (lineString startsWith:'include') ifTrue:[
+                                            (lineString startsWith:'includeResourcesFor') ifTrue:[
+                                                "/ include those resources ...
+                                                rest := lineString copyFrom:('includeResourcesFor' size + 1).
+                                                value := Compiler evaluate:rest compile:false.
+                                                value isBehavior ifTrue:[
+                                                    pack := self class for:value.
+                                                    pack notNil ifTrue:[
+                                                        self addAll:pack.
+                                                    ]
+                                                ]
+                                            ] ifFalse:[
+                                                rest := lineString copyFrom:('include' size + 1).
+                                                value := Compiler evaluate:rest compile:false.
+                                                value isString ifFalse:[
+                                                    printError value:('bad include filename: ' , value printString, ' "',lineString,'"').
+                                                ] ifTrue:[
+                                                    self readFromFile:value directory:dirName
                                                 ]
                                             ]
                                         ] ifFalse:[
-                                            rest := lineString copyFrom:('include' size + 1).
-                                            value := Compiler evaluate:rest compile:false.
-                                            value isString ifFalse:[
-                                                printError value:('bad include filename: ' , value printString, ' "',lineString,'"').
-                                            ] ifTrue:[
-                                                self readFromFile:value directory:dirName
+                                            (lineString startsWith:'encoding') ifTrue:[
+                                                encoding := self class extractEncodingFromLine:lineString.
+                                                decoder := CharacterEncoder encoderFor:encoding ifAbsent:nil.
                                             ]
                                         ]
-                                    ] ifFalse:[
-                                        (lineString startsWith:'encoding') ifTrue:[
-                                            encoding := self class extractEncodingFromLine:lineString.
-                                            decoder := CharacterEncoder encoderFor:encoding ifAbsent:nil.
-                                        ]
                                     ]
                                 ]
                             ]
@@ -1185,7 +1208,7 @@
     ^ ok
 
     "Modified: / 31-08-1995 / 02:33:45 / claus"
-    "Modified: / 05-07-2006 / 16:36:43 / cg"
+    "Modified: / 18-09-2006 / 18:48:02 / cg"
 ! !
 
 !ResourcePack methodsFor:'printing & storing'!
@@ -1202,7 +1225,7 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.113 2006-09-18 16:30:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.114 2006-09-18 16:50:38 cg Exp $'
 ! !
 
 ResourcePack initialize!