5

I am working with Pharo Smalltalk. Suppose you want to save your own group of packages into a local repository, you know that your packages are prefixed with "MyPrefix". What's the right message to do it? In code:

| myPkgs |
myPkgs := MCPackage allInstances select: [: mcPkg | mcPkg name beginsWith: 'MyPrefix' ].
myPkgs do: [ : myPkg | myPkg ??? ].

It would be too difficult to script that one for a web based repository?

MartinW
  • 4,966
  • 2
  • 24
  • 60
Juan Aguerre
  • 388
  • 2
  • 7

2 Answers2

2
packages := Gofer new allResolved
        collect: [ :each | each packageName ] as: Set.
packages := packages select: [ :e | e beginsWith: 'Prefix' ].

gofer := Gofer new
    disablePackageCache;
    directory: '/path/to/repo'.
packages do: [ :p | gofer package: p ].
gofer commit: ''.
Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37
1

The same way as you load or update a group of packages:

Gofer new
    squeaksource: 'MyProject';
    package: 'MyPrefix-Core';
    package: 'MyPrefix-Tests';
    commit

More information you find in this blog post: Gofer — Monticello and Groups of Packages.

Lukas Renggli
  • 8,754
  • 23
  • 46