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

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


On Monday 09 December 2002 05:47 pm, Ned Konz wrote:
> 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
> which I'd loaded a prior version of StarBrowser. I made a SAR with
> the new version, and am loading in the DVS packages with this
> SARInstaller method:
>
> fileInPackageNamed: memberName
> =09"This is to be used from preamble/postscript code to file in zip
> =09members as DVS packages."
>
> =09| member current new baseName imagePackageLoader packageInfo
>
> 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. current _ 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 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:
> #unload] !
> Smalltalk at: #IntentionalClassification ifPresent: [:c | c
> removeSelector: #asExtentionalClassification] !
> Smalltalk at: #AbstractItem ifPresent: [:c | c removeSelector:
> #addDependent:] !
> Smalltalk at: #AbstractClassification ifPresent: [:c | c
> removeSelector: #addDependent:] !
>
> But then (and this is where I get a walkback), it's removing the
> newly 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
> organization addCategory: 'Classifications'" as a DoItChunk, while
> the ImagePackageLoader sees it as a SystemCategoryChunk.
>
> This is with DVS 1.66.
>
> Ideas?

which is due to the string in the .st file being:
'SystemOrganization addCategory: #Classifications'

and the SystemCategoryChunk's pattern being:
 'Smalltalk organization addCategory: *'

The "SystemOrganization addCategory:" comes from=20
PackageInfo>>fileOutOnStream:

So it seems that we need to get DVS and PackageInfo to agree on what a=20
category chunk looks like.

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