[Pharo-project] How to get the list of packages of a repository?
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
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
Simpler: (Gofer new disablePackageCache; squeaksource: 'Seaside30'; allResolved) collect: [ :each | each packageName ] as: Set Lukas On 7 November 2011 21:21, jannik.laval <jannik.laval@gmail.com> wrote:
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
-- Lukas Renggli www.lukas-renggli.ch
Excellent. Thanks guys :) Wouldn't make sense to have that code in a #allPackagesNames ? Thanks! On Mon, Nov 7, 2011 at 6:02 PM, Lukas Renggli <renggli@gmail.com> wrote:
Simpler:
(Gofer new disablePackageCache; squeaksource: 'Seaside30'; allResolved) collect: [ :each | each packageName ] as: Set
Lukas
On 7 November 2011 21:21, jannik.laval <jannik.laval@gmail.com> wrote:
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
-- Lukas Renggli www.lukas-renggli.ch
-- Mariano http://marianopeck.wordpress.com
Wouldn't make sense to have that code in a #allPackagesNames ?
It would be kind of strange, because typically on a Gofer instance you need to specify the packages you want to deal with. Lukas
Thanks!
On Mon, Nov 7, 2011 at 6:02 PM, Lukas Renggli <renggli@gmail.com> wrote:
Simpler:
(Gofer new     disablePackageCache;     squeaksource: 'Seaside30';     allResolved)     collect: [ :each | each packageName ] as: Set
Lukas
On 7 November 2011 21:21, jannik.laval <jannik.laval@gmail.com> wrote:
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
-- Lukas Renggli www.lukas-renggli.ch
-- Mariano http://marianopeck.wordpress.com
-- Lukas Renggli www.lukas-renggli.ch
On 11/7/11 13:58 PM, "Mariano Martinez Peck" <marianopeck@gmail.com> 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
Hi Mariano I attach my version of CodeLoader, explore it and maybe have the answer You could do: | loader | loader _ CodeLoader new. loader baseURL:'http://www.squeaksource.com/Ladrillos/'. loader installLastMonticelloFor: #('DynamicBindings' 'KomServices' 'KomHttpServer' );installSourceFiles. And load morphs or projects if you have the url and the logic Improvements, very welcomed :=) Edgar
participants (4)
-
Edgar J. De Cleene -
jannik.laval -
Lukas Renggli -
Mariano Martinez Peck