Storing local code in a local repository?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Storing local code in a local repository?

Rick Flower
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!

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Paolo Bonzini-2
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

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

gst-site-packages.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Stefan Schmiedl
On Thu, 03 Jun 2010 10:01:33 +0200
Paolo Bonzini <[hidden email]> wrote:

> 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.

+1. An image-independent place for "my global stuff" makes some things easier.

s.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
In reply to this post by Paolo Bonzini-2
On Thu, 03 Jun 2010 10:01:33 +0200, Paolo Bonzini <[hidden email]> wrote:

> 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.

Thanks Paolo!!

I'm trying to use it but am not completely sure of the format
for the packages.xml file.. Below is the current incarnation I'm
using which is not working :

<packages>

<package>
  <name>AddOns</name>
  <file>VisualWorksExtensions.st</file>
<package>

</packages>

It gives me this when I try to use the following packageLoader
line :

PackageLoader fileInPackage: #VisualWorksExtensions.


Object: Package new "<-0x53dbde8>" error: error in packages file:
unmatched end tag package
Error(Exception)>>signal (ExcHandling.st:254)
Error(Exception)>>signal: (ExcHandling.st:264)
Package(Object)>>error: (SysExcept.st:1444)
[] in Package>>parse:tag: (PkgLoader.st:1585)
BlockClosure>>ensure: (BlkClosure.st:269)
Package>>parse:tag: (PkgLoader.st:1570)
Package class>>parse: (PkgLoader.st:1229)
Kernel.PackageDirectory(Kernel.PackageContainer)>>parse:
(PkgLoader.st:363)
optimized [] in Kernel.PackageDirectory>>refreshPackageList
(PkgLoader.st:432)

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Paolo Bonzini-2
On 06/03/2010 05:11 PM, Rick Flower wrote:
> <packages>
>
> <package>
>    <name>AddOns</name>
>    <file>VisualWorksExtensions.st</file>
> <package>
>
> </packages>

That seems to be correct for me, except that you would also need a

   <filein>VisualWorksExtensions.st</filein>

However, that wouldn't justify the failure you get from #fileInPackage:.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
I'll give it a shot when I get back in the office...

On Jun 3, 2010, at 8:45 AM, Paolo Bonzini <[hidden email]> wrote:

> On 06/03/2010 05:11 PM, Rick Flower wrote:
>> <packages>
>>
>> <package>
>>   <name>AddOns</name>
>>   <file>VisualWorksExtensions.st</file>
>> <package>
>>
>> </packages>
>
> That seems to be correct for me, except that you would also need a
>
>  <filein>VisualWorksExtensions.st</filein>
>
> However, that wouldn't justify the failure you get from  
> #fileInPackage:.
>
> Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Stefan Schmiedl
On Thu, 3 Jun 2010 09:31:32 -0700
Rick Flower <[hidden email]> wrote:

> I'll give it a shot when I get back in the office...

Then while you're at it ...

>
> On Jun 3, 2010, at 8:45 AM, Paolo Bonzini <[hidden email]> wrote:
>
> > On 06/03/2010 05:11 PM, Rick Flower wrote:
> >> <packages>
> >>
> >> <package>
> >>   <name>AddOns</name>
> >>   <file>VisualWorksExtensions.st</file>
> >> <package>

change the line above to </package>, too.

s.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Paolo Bonzini-2
On 06/03/2010 06:46 PM, Stefan Schmiedl wrote:

> On Thu, 3 Jun 2010 09:31:32 -0700
> Rick Flower<[hidden email]>  wrote:
>
>> I'll give it a shot when I get back in the office...
>
> Then while you're at it ...
>
>>
>> On Jun 3, 2010, at 8:45 AM, Paolo Bonzini<[hidden email]>  wrote:
>>
>>> On 06/03/2010 05:11 PM, Rick Flower wrote:
>>>> <packages>
>>>>
>>>> <package>
>>>>    <name>AddOns</name>
>>>>    <file>VisualWorksExtensions.st</file>
>>>> <package>
>
> change the line above to</package>, too.

Ouch. :-)

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
On Thu, 03 Jun 2010 19:09:29 +0200, Paolo Bonzini <[hidden email]> wrote:

> On 06/03/2010 06:46 PM, Stefan Schmiedl wrote:
>> On Thu, 3 Jun 2010 09:31:32 -0700
>> Rick Flower<[hidden email]>  wrote:
>>
>>> I'll give it a shot when I get back in the office...
>>
>> Then while you're at it ...
>>
>>>
>>> On Jun 3, 2010, at 8:45 AM, Paolo Bonzini<[hidden email]>  wrote:
>>>
>>>> On 06/03/2010 05:11 PM, Rick Flower wrote:
>>>>> <packages>
>>>>>
>>>>> <package>
>>>>>    <name>AddOns</name>
>>>>>    <file>VisualWorksExtensions.st</file>
>>>>> <package>
>>
>> change the line above to</package>, too.

Ok.. Fixed.. Thanks for catching that!  I was in
a hurry for my physical therapy appt.. Here's the
updated stuff :

<packages>

<package>
  <name>AddOns</name>
  <filein>VisualWorksExtensions.st</filein>
</package>

</packages>

It still isn't finding it (and yes, I did apply the earlier
patch that was sent out and did a "make install" to get it
pushed out to my baseline installation.

So, here's my directory setup :

~/gst/share/smalltalk/site-packages
~/gst/share/smalltalk/site-packages/packages.xml
~/gst/share/smalltalk/site-packages/VisualWorksExtensions.st
~/gst/share/smalltalk/packages.xml

I've added offending lines to the ~/gst/share/smalltalk/packages.xml
with no change in behavior..  Is there supposed to be a
new packages.xml in the 'site-packages' directory or
should it be part of the packages.xml one level up?

Based on the comments in PackageLoader class >>refresh,
I believe the comments should probably be updated to
indicate (if this patch is made part of the baseline)
that this extra path is also searched.

Let me know if I'm off base..
 

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
On Thu, 03 Jun 2010 11:01:55 -0700, Rick Flower <[hidden email]>
wrote:

I should note that the entire contents of my
site-packages/packages.xml is as follows:

<packages>

<package>
  <name>AddOns</name>
  <file>VisualWorksExtensions</file>
  <filein>VisualWorksExtensions.st</filein>
</package>

</packages>

Not sure if that matters -- perhaps something
is missing?  It might be time to put some path
dumping logic in the package loader to see
what it's looking for.. I'll keep you posted!

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
On Thu, 03 Jun 2010 11:12:20 -0700, Rick Flower <[hidden email]>
wrote:
> On Thu, 03 Jun 2010 11:01:55 -0700, Rick Flower <[hidden email]>
> wrote:
>
> I should note that the entire contents of my
> site-packages/packages.xml is as follows:

...

Ok.. Had to instrument things a bit to see what
was going on.. It appears (but I've not yet
verified) that the new packages.xml in the site
directory is not being pulled in.. Nothing in that
file is getting pulled into the "root" object at
all.. I'll continue poking around.. Perhaps
something is missing that I haven't found yet.

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Paolo Bonzini-2
In reply to this post by Rick Flower
On 06/03/2010 08:01 PM, Rick Flower wrote:

> So, here's my directory setup :
>
> ~/gst/share/smalltalk/site-packages
> ~/gst/share/smalltalk/site-packages/packages.xml
> ~/gst/share/smalltalk/site-packages/VisualWorksExtensions.st
> ~/gst/share/smalltalk/packages.xml
>
> I've added offending lines to the ~/gst/share/smalltalk/packages.xml
> with no change in behavior..  Is there supposed to be a
> new packages.xml in the 'site-packages' directory or
> should it be part of the packages.xml one level up?

Yes, it should be in the site-packages directory.  I'll test it in the
weekend.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Storing local code in a local repository?

Rick Flower
On Fri, 04 Jun 2010 10:14:35 +0200, Paolo Bonzini <[hidden email]> wrote:

> On 06/03/2010 08:01 PM, Rick Flower wrote:
>> So, here's my directory setup :
>>
>> ~/gst/share/smalltalk/site-packages
>> ~/gst/share/smalltalk/site-packages/packages.xml
>> ~/gst/share/smalltalk/site-packages/VisualWorksExtensions.st
>> ~/gst/share/smalltalk/packages.xml
>>
>> I've added offending lines to the ~/gst/share/smalltalk/packages.xml
>> with no change in behavior..  Is there supposed to be a
>> new packages.xml in the 'site-packages' directory or
>> should it be part of the packages.xml one level up?
>
> Yes, it should be in the site-packages directory.  I'll test it in the
> weekend.

Paolo..

I was able to track it down.. I didn't realize (Duh!!!) that
the package name must match the name you've asked to load..
Once I did that all was good..

Below is my sample packages.xml file :

<packages>
<package>
  <name>VisualWorksExtensions</name>
  <filein>VisualWorksExtensions.st</filein>
  <file>VisualWorksExtensions.st</file>
</package>
</packages>

The following line causes this package to be loaded:

PackageLoader fileInPackage: #VisualWorksExtensions.

If we can get this included as a regular feature, that would
be great! Thanks again!

-- Rick

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk