Hi all..
One of the things I like to do is to put a tag on my applications that indicate what version is being used. I'm currently using VW and would like to use the tag that is generated for me by my local Store Repository -- I just don't have any idea how to obtain the string such as "2.10.10,rickf" or similar.. Is there any easy way to do this? Also -- would that string still be available in a headless/trimmed image as well? (e.g. it wouldn't disappear as part of the finalization process) |
In our deployment process for both clients and servers, we just take the
current store version and save it someplace safe for display purposes and such. Try, (Store.Registry bundleNamed: 'MyBundle') traceVersion Cheers, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: Rick Flower [mailto:[hidden email]] Sent: Friday, October 06, 2006 11:22 AM To: VisualWorks Mailing List Subject: Obtaining the VW version tag for a bundle. Hi all.. One of the things I like to do is to put a tag on my applications that indicate what version is being used. I'm currently using VW and would like to use the tag that is generated for me by my local Store Repository -- I just don't have any idea how to obtain the string such as "2.10.10,rickf" or similar.. Is there any easy way to do this? Also -- would that string still be available in a headless/trimmed image as well? (e.g. it wouldn't disappear as part of the finalization process) |
Boris Popov wrote:
> In our deployment process for both clients and servers, we just take the > current store version and save it someplace safe for display purposes > and such. Try, > > (Store.Registry bundleNamed: 'MyBundle') traceVersion Thanks Boris.. I tried that though and it comes up with an empty string for some reason. If I remove the "traceVersion" message, I get a nice object back (of type Store.BundleModel) and I can examine it just fine and have been able to find my version string hidden down in the bowels of the object, but am not sure how to retrieve it. I see the object as follows : a1 := (Store.Registry bundleNamed: 'MyScrip') Upon inspecting "a1" and examining "dbInfo" then looking in the identity dictionary entry "#MyScrip", I get a DatabaseConnectionBundleInformation object which has an instance variable called "versionString".. Is there some easy way to drill down into that to get my "2.10.10,rickf" byte string or is something not working properly in my Store repository? If it matters, I am not connected currently to the repository -- is that going to make a difference here? I'd hope not.. Any help would be much appreciated! |
#traceVersion will only give you a string back if you're connected to
your source repository, but if you find it deep within the object as well, you could just write an accessor for it whereever it is, Cheers! -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: Rick Flower [mailto:[hidden email]] Sent: Friday, October 06, 2006 11:50 AM To: Boris Popov Cc: VisualWorks Mailing List Subject: Re: Obtaining the VW version tag for a bundle. Boris Popov wrote: > In our deployment process for both clients and servers, we just take the > current store version and save it someplace safe for display purposes > and such. Try, > > (Store.Registry bundleNamed: 'MyBundle') traceVersion Thanks Boris.. I tried that though and it comes up with an empty string for some reason. If I remove the "traceVersion" message, I get a nice object back (of type Store.BundleModel) and I can examine it just fine and have been able to find my version string hidden down in the bowels of the object, but am not sure how to retrieve it. I see the object as follows : a1 := (Store.Registry bundleNamed: 'MyScrip') Upon inspecting "a1" and examining "dbInfo" then looking in the identity dictionary entry "#MyScrip", I get a DatabaseConnectionBundleInformation object which has an instance variable called "versionString".. Is there some easy way to drill down into that to get my "2.10.10,rickf" byte string or is something not working properly in my Store repository? If it matters, I am not connected currently to the repository -- is that going to make a difference here? I'd hope not.. Any help would be much appreciated! |
Boris Popov wrote:
> #traceVersion will only give you a string back if you're connected to > your source repository, but if you find it deep within the object as > well, you could just write an accessor for it whereever it is, Hmm.. I might have to poke around and see if Store supports calling a specified method when it does the publish (perhaps just before) to allow the bundle being published to do something custom -- in this case, it could squirrel away the version info in a class-side variable somewhere and it would stay that way until the next time a publish was done.. I kind of doubt that sort of functionality exists, but I can dream can't I? |
There's a pre-save action on pundles, but I've always had to hack the
system to actually trigger it on Store Publish (it only works on parcel save as is). I don't have my hack handy, but I recall it wasn't hard to find where publish goes through and calling #runPreSave there with a help of an override. Having said that, I do it the other way around, I steal the version number in the post-load, [:package | Launcher applicationVersion: package traceVersion. ] because I don't really care what it is during development and we have a separate script for deployment that sets the correct version then, Hope this helps, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: Rick Flower [mailto:[hidden email]] Sent: Friday, October 06, 2006 12:52 PM To: VisualWorks Mailing List Subject: Re: Obtaining the VW version tag for a bundle. Boris Popov wrote: > #traceVersion will only give you a string back if you're connected to > your source repository, but if you find it deep within the object as > well, you could just write an accessor for it whereever it is, Hmm.. I might have to poke around and see if Store supports calling a specified method when it does the publish (perhaps just before) to allow the bundle being published to do something custom -- in this case, it could squirrel away the version info in a class-side variable somewhere and it would stay that way until the next time a publish was done.. I kind of doubt that sort of functionality exists, but I can dream can't I? |
In reply to this post by Rick Flower
Rick,
This is what I do, but then I don't strip the image so I don't know if it is valid otherwise. versionNumber | bundles | bundles := Store.BundleModel allInstances select: [:each | each name = 'MyBundle']. ^bundles inject: 0 into: [:max :each | (each versionString asArrayOfSubstrings at: 2) asNumber max: max]. ----- Original Message ----- From: "Rick Flower" <[hidden email]> To: "Boris Popov" <[hidden email]> Cc: "VisualWorks Mailing List" <[hidden email]> Sent: Friday, October 06, 2006 1:49 PM Subject: Re: Obtaining the VW version tag for a bundle. > Boris Popov wrote: >> In our deployment process for both clients and servers, we just take the >> current store version and save it someplace safe for display purposes >> and such. Try, >> >> (Store.Registry bundleNamed: 'MyBundle') traceVersion > > Thanks Boris.. I tried that though and it comes up with an empty string > for some reason. If I remove the "traceVersion" message, I get a nice > object back (of type Store.BundleModel) and I can examine it just fine and > have been able to find my version string hidden down in the bowels of the > object, but am not sure how to retrieve it. I see the object as follows : > > a1 := (Store.Registry bundleNamed: 'MyScrip') > > Upon inspecting "a1" and examining "dbInfo" then looking in the identity > dictionary entry "#MyScrip", I get a DatabaseConnectionBundleInformation > object which has an instance variable called "versionString".. Is there > some easy way to drill down into that to get my "2.10.10,rickf" byte > string or is something not working properly in my Store repository? > > If it matters, I am not connected currently to the repository -- is that > going to make a difference here? I'd hope not.. > > Any help would be much appreciated! > > |
But then "(Store.Registry bundleNamed: 'MyBundle') versionString" is all I
really need to do. I must be missing your point somehow. ----- Original Message ----- From: "Charlie Adams" <[hidden email]> To: "Rick Flower" <[hidden email]>; "Boris Popov" <[hidden email]> Cc: "VisualWorks Mailing List" <[hidden email]> Sent: Friday, October 06, 2006 3:42 PM Subject: Re: Obtaining the VW version tag for a bundle. > Rick, > > This is what I do, but then I don't strip the image so I don't know if it > is valid otherwise. > > versionNumber > > | bundles | > bundles := Store.BundleModel allInstances select: [:each | each name = > 'MyBundle']. > ^bundles inject: 0 into: [:max :each | > (each versionString asArrayOfSubstrings at: 2) asNumber max: max]. > > > ----- Original Message ----- > From: "Rick Flower" <[hidden email]> > To: "Boris Popov" <[hidden email]> > Cc: "VisualWorks Mailing List" <[hidden email]> > Sent: Friday, October 06, 2006 1:49 PM > Subject: Re: Obtaining the VW version tag for a bundle. > > >> Boris Popov wrote: >>> In our deployment process for both clients and servers, we just take the >>> current store version and save it someplace safe for display purposes >>> and such. Try, >>> >>> (Store.Registry bundleNamed: 'MyBundle') traceVersion >> >> Thanks Boris.. I tried that though and it comes up with an empty string >> for some reason. If I remove the "traceVersion" message, I get a nice >> object back (of type Store.BundleModel) and I can examine it just fine >> and have been able to find my version string hidden down in the bowels of >> the object, but am not sure how to retrieve it. I see the object as >> follows : >> >> a1 := (Store.Registry bundleNamed: 'MyScrip') >> >> Upon inspecting "a1" and examining "dbInfo" then looking in the identity >> dictionary entry "#MyScrip", I get a DatabaseConnectionBundleInformation >> object which has an instance variable called "versionString".. Is there >> some easy way to drill down into that to get my "2.10.10,rickf" byte >> string or is something not working properly in my Store repository? >> >> If it matters, I am not connected currently to the repository -- is that >> going to make a difference here? I'd hope not.. >> >> Any help would be much appreciated! >> >> > > |
Charlie Adams wrote:
> But then "(Store.Registry bundleNamed: 'MyBundle') versionString" is all > I really need to do. I must be missing your point somehow. Bingo! That worked like a charm.. Thanks! Now to plug it into my code somewhere.. Thanks again Charlie & Boris! |
In reply to this post by Boris Popov, DeepCove Labs (SNN)
One reason it will only give you a string back if you're connected to your source repository is that the image can connect to multiple different repositories (although only one at a time) and a particular package or bundle may be published with different version numbers in different repositories.
aPundle databaseInformationFor: #uniqueDatabaseId should give you access to the thing that holds the version strings for that database. However, if you haven't asked for it while the database is connected, it may not have the information. It's cached, but not read until used. At 03:28 PM 10/6/2006, Boris Popov wrote: >#traceVersion will only give you a string back if you're connected to >your source repository, but if you find it deep within the object as >well, you could just write an accessor for it whereever it is, > >Cheers! > >-Boris > >-- >+1.604.689.0322 >DeepCove Labs Ltd. >4th floor 595 Howe Street >Vancouver, Canada V6C 2T5 > >[hidden email] > >CONFIDENTIALITY NOTICE > >This email is intended only for the persons named in the message >header. Unless otherwise indicated, it contains information that is >private and confidential. If you have received it in error, please >notify the sender and delete the entire message including any >attachments. > >Thank you. > >-----Original Message----- >From: Rick Flower [mailto:[hidden email]] >Sent: Friday, October 06, 2006 11:50 AM >To: Boris Popov >Cc: VisualWorks Mailing List >Subject: Re: Obtaining the VW version tag for a bundle. > >Boris Popov wrote: >> In our deployment process for both clients and servers, we just take >the >> current store version and save it someplace safe for display purposes >> and such. Try, >> >> (Store.Registry bundleNamed: 'MyBundle') traceVersion > >Thanks Boris.. I tried that though and it comes up with an empty string >for some reason. If I remove the "traceVersion" message, I get a nice >object back (of type Store.BundleModel) and I can examine it just fine >and have been able to find my version string hidden down in the bowels >of the object, but am not sure how to retrieve it. I see the object as >follows : > >a1 := (Store.Registry bundleNamed: 'MyScrip') > >Upon inspecting "a1" and examining "dbInfo" then looking in the identity > >dictionary entry "#MyScrip", I get a DatabaseConnectionBundleInformation > >object which has an instance variable called "versionString".. Is there >some easy way to drill down into that to get my "2.10.10,rickf" byte >string or is something not working properly in my Store repository? > >If it matters, I am not connected currently to the repository -- is that > >going to make a difference here? I'd hope not.. > >Any help would be much appreciated! -- Alan Knight [|], Cincom Smalltalk Development [hidden email] [hidden email] http://www.cincom.com/smalltalk "The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross |
Free forum by Nabble | Edit this page |