[Seaside] [DVS] loading new versions doesn't remove old methods

Ned Konz seaside@lists.squeakfoundation.org
Mon, 9 Dec 2002 17:47:35 -0800


On Monday 09 December 2002 02:48 pm, Avi Bryant wrote:
> On Mon, 9 Dec 2002, Ned Konz wrote:
> > On Monday 09 December 2002 02:19 pm, Avi Bryant wrote:
> > >  need to use the PackagePanel FileIn button instead.  Load is
> > > meant for bringing in new versions, not updating existing ones.
> > >  To address your main point of confusion - the .st files are
> > > straight file outs, it's the way they're filed in that's
> > > special.
> >
> > What if the same .st file was previously filed in directly (i.e.
> > not using DVS)? Would the subsequent "File In" work right?
>
> Yes.  That's exactly what happens in the PackagePanel (Load files
> it in directly, after that you always use FileIn).

Hmm... your suggestion isn't working for me. I have an image into=20
which I'd loaded a prior version of StarBrowser. I made a SAR with=20
the new version, and am loading in the DVS packages with this=20
SARInstaller method:

fileInPackageNamed: memberName=20
=09"This is to be used from preamble/postscript code to file in zip=20
=09members as DVS packages."
=09| member current new baseName imagePackageLoader packageInfo=20
streamPackageLoader |
=09member _ self zip memberNamed: memberName.
=09member
=09=09ifNil: [self inform: 'no member named ' , memberName.
=09=09=09^ self].
=09imagePackageLoader _ Smalltalk
=09=09=09=09at: #ImagePackageLoader
=09=09=09=09ifAbsent: [].
=09streamPackageLoader _ Smalltalk
=09=09=09=09at: #StreamPackageLoader
=09=09=09=09ifAbsent: [].
=09packageInfo _ Smalltalk
=09=09=09=09at: #PackageInfo
=09=09=09=09ifAbsent: [].
=09(packageInfo isNil
=09=09=09or: [imagePackageLoader isNil
=09=09=09=09=09or: [streamPackageLoader isNil]])
=09=09ifTrue: [^ self fileInMemberNamed: memberName].
=09baseName _ memberName copyReplaceAll: '.st' with: '' asTokens: false.
=09current _ imagePackageLoader new
=09=09=09=09package: (packageInfo named: baseName).
=09new _ streamPackageLoader new stream: member contentStream ascii.
=09(new changesFromBase: current) fileIn

What's happening, though, is that the last line (the fileIn) is doing=20
this (say for Classifications.st):

SystemOrganization addCategory: #Classifications

then it defines/changes some methods in that category.

Then it removes some methods:

Smalltalk at: #ItemService ifPresent: [:c | c class removeSelector:=20
#unload] !
Smalltalk at: #IntentionalClassification ifPresent: [:c | c=20
removeSelector: #asExtentionalClassification] !
Smalltalk at: #AbstractItem ifPresent: [:c | c removeSelector:=20
#addDependent:] !
Smalltalk at: #AbstractClassification ifPresent: [:c | c=20
removeSelector: #addDependent:] !

But then (and this is where I get a walkback), it's removing the newly=20
freshened, non-empty category:

Smalltalk organization removeCategory: ''Classifications''

The problem is that the first chunk in:
current chunksWithNoVersionIn: new
is a SystemCategoryChunk for Classifications.

This is because the StreamPackageLoader is interpreting "Smalltalk=20
organization addCategory: 'Classifications'" as a DoItChunk, while=20
the ImagePackageLoader sees it as a SystemCategoryChunk.

This is with DVS 1.66.

Ideas?
--=20
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE