On 06/03/2010 03:20 AM, Rick Flower wrote:
Paolo,
I've got some code that I'd like to pull into several
different scripts that is common between them and
would like to store them in a local directory somewhere
and do not want to store them inside the installation
tree that could (in theory) get nuked if someone
thinks only 'release' files live there.. To that end,
I'd like to tell the package loader to pull in my
local code.. Is there an easy way to get this sort
of behavior in gst? Thx!
You can put the packages in the image directory if you're using the
default image in (/usr/local)/var/lib/smalltalk.
If not, something like the attached would work though. The directory
would be /usr/(local/)share/smalltalk/site-packages. You can group the
code into a .star file, or use a
/usr/(local/)share/smalltalk/site-packages/packages.xml file.
Anybody else, any interest in having this patch in 3.2.1? It's small
and harmless enough.
Thanks,
Paolo
diff --git a/kernel/PkgLoader.st b/kernel/PkgLoader.st
index 840890f..cd0db90 100644
--- a/kernel/PkgLoader.st
+++ b/kernel/PkgLoader.st
@@ -1836,6 +1836,10 @@ into a Smalltalk image, correctly handling
dependencies.'>
baseDirectories: [
{Directory userBase.
Directory kernel / '..'}]).
+ root add: (Kernel.PackageDirectory on: self sitePackageFile
+ baseDirectories: [
+ {Directory userBase.
+ Directory kernel / '../site-packages'}]).
root add: (Kernel.PackageDirectory on: self userPackageFile
baseDirectories: [{Directory userBase}]).
root add: (Kernel.PackageDirectory on: self localPackageFile
@@ -1891,6 +1895,11 @@ into a Smalltalk image, correctly handling
dependencies.'>
^Directory kernel / '../packages.xml'
]
+ PackageLoader class >> sitePackageFile [
+ <category: 'private - packages file'>
+ ^Directory kernel / '../site-packages/packages.xml'
+ ]
+
PackageLoader class >> userPackageFile [
<category: 'private - packages file'>
^Directory userBase / 'packages.xml'
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk