[Pharo-project] How to get the list of packages of a repository?

jannik.laval jannik.laval at gmail.com
Mon Nov 7 15:21:32 EST 2011


Hi Mariano,
You can have all packages in a repository with:

====
repository := MCHttpRepository 
		location: httpUrl
		user: ''
		password: ''
repository allVersionNames
====

Then you have to select all the last version of each package.
A method from Moose that have this behavior:

===
lastVersionOf: projectName 
	| versions |
	versions := self fileNames select: [ :f | f beginsWith: projectName , '-' ].
	^ (versions asSortedCollection: 
		[ :v1 :v2 | 
		(v1 
			copyFrom: (v1 indexOf: $.) + 1
			to: (v1 lastIndexOf: $.)) asInteger < (v2 
				copyFrom: (v2 indexOf: $.) + 1
				to: (v2 lastIndexOf: $.)) asInteger ]) last
===

Cheers,
Jannik

On Nov 7, 2011, at 17:58 , Mariano Martinez Peck wrote:

> Hi guys. Is there a way to get a list of packages or packages names of a squeaksource repo?  For example, I would love to do:
> 
> Gofer it
> squeaksource: 'xxx';
> allPackages.
> 
> is that possible?
> 
> Thanks
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com
> 

---
Jannik Laval

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20111107/bd7da843/attachment-0001.html>


More information about the Pharo-dev mailing list