On 04/24/2010 09:02 PM, Paolo Bonzini wrote: > Does it work for "fake" packages that are declared in packages.xml > (iirc two of these are Regex or MD5)?
I tried various ways. E.g. using (PackageLoader packageAt: package) fullPathOf: 'package.xml' but that didn't really work for the MD5 package either (it did some times). I have opted for adding a #describe to Package and one to the StartPackage too. Is that any good? > >> I'm also >> working on a patch to inject the right directory into the baseDirectories. > > Makes sense, thanks! I still have some problems with the scripts/Package.st to fully understand how it is handling the --test... so this takes some more time.
>From 879c8e7d0b48201a5b5662bf280b3b621a97e1a9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther <[email protected]> Date: Sat, 24 Apr 2010 13:09:09 +0800 Subject: [PATCH 1/5] Indicate which package file was loaded for the package name. This can be extremely helpful when trying to figure out if the changed code of a package was ran or the initial one. 2010-04-24 Holger Hans Peter Freyther <[email protected]> * kernel/PkgLoader.st: Print the file name of the package that will be loaded. Add Package>>describe and StarPackage>>describe to describe the origin. --- ChangeLog | 6 ++++++ kernel/PkgLoader.st | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4aed11..d2701a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-24 Holger Hans Peter Freyther <[email protected]> + + * kernel/PkgLoader.st: Print the file name of the package that will + be loaded. Add Package>>describe and StarPackage>>describe to + describe the origin. + 2010-04-15 Paolo Bonzini <[email protected]> * kernel/Regex.st: Fix printing a MatchingRegexResults. diff --git a/kernel/PkgLoader.st b/kernel/PkgLoader.st index 840890f..e0e24d5 100644 --- a/kernel/PkgLoader.st +++ b/kernel/PkgLoader.st @@ -1094,6 +1094,11 @@ PackageInfo subclass: StarPackage [ loadedPackage := package. ^loadedPackage ] + + describe [ + <category: 'accessing'> + ^self name, ' from ', self fileName + ] ] ] @@ -1602,6 +1607,11 @@ XML.'> [self error: 'error in packages file: unmatched start tags' , stack asArray printString]] ] + + describe [ + <category: 'accessing'> + ^self name + ] ] @@ -1865,7 +1875,8 @@ into a Smalltalk image, correctly handling dependencies.'> OutputVerbosity > 0 ifTrue: [Transcript - nextPutAll: 'Loading package ' , each; + nextPutAll: 'Loading package ' , + (self packageAt: each) describe; nl]. (self packageAt: each) primFileIn] ] -- 1.7.0.1
_______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
