[Pharo-project] Getting and loading each version of a package? (Gofer?)

Lukas Renggli renggli at gmail.com
Thu Oct 6 09:34:12 EDT 2011


Way easier is to ask the Gofer instance setup with repositories for
#allReferences. You then get objects with each reachable version, and
can access things like version number, package name, branch name,
author name, ... using the accessors. To load the version you simply
call #load.

Lukas

On 6 October 2011 15:28, Schwab,Wilhelm K <bschwab at anest.ufl.edu> wrote:
> Mariano,
>
> Below is something that was getting yanked from or with ScriptLoader, so I included it in Migrate.  The enumerating of versions could be of interest to you.
>
> Bill
>
>
> loadLatestPackage: aString fromRepository: aRepository
>        "1-10 - too useful to be without really, I created another.  Shamelessly
>        stolen from ScriptLoader."
>
>        | versionsBlock versions tries version |
>
>        versionsBlock := [ (aRepository allVersionNames select: [ :each |
>                each beginsWith: aString ])
>                asSortedCollection: [ :a :b |
>                        (a copyAfterLast: $.) asNumber <= (b copyAfterLast: $.) asNumber]].
>        versions := versionsBlock value.
>        tries := 0.
>        [ versions isEmpty and: [ tries < 3 ] ] whileTrue: [
>                versions := versionsBlock value.
>                tries := tries + 1 ].
>        versions isEmpty ifTrue: [ self error: 'problems when accessing repository' ].
>
>        aRepository versionReaderForFileNamed: (versions last , '.mcz') do: [:reader |
>                version := reader version.
>                version load.
>                version workingCopy repositoryGroup addRepository: aRepository].
>
>
> ________________________________________
> From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Mariano Martinez Peck [marianopeck at gmail.com]
> Sent: Thursday, October 06, 2011 9:23 AM
> To: Pharo-project at lists.gforge.inria.fr
> Subject: Re: [Pharo-project] Getting and loading each version of a package?     (Gofer?)
>
> I need help with only one thing....get the list of version of a package. I can manage the rest...
> So I would like tp get all the versions of the package Fuel of the squeaksource Fuel repo...
>
> thanks in advance,
>
>
> On Thu, Oct 6, 2011 at 11:51 AM, Mariano Martinez Peck <marianopeck at gmail.com<mailto:marianopeck at gmail.com>> wrote:
>
>
> On Thu, Oct 6, 2011 at 11:50 AM, HwaJong Oh <daliot.oh at gmail.com<mailto:daliot.oh at gmail.com>> wrote:
> Mariano,
>
> For metacello or monticello?
>
> Monticello.
>
>
>
> HwaJong Oh
>
> --
> View this message in context: http://forum.world.st/Getting-and-loading-each-version-of-a-package-Gofer-tp3877374p3877588.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>



-- 
Lukas Renggli
www.lukas-renggli.ch




More information about the Pharo-dev mailing list