2011-11-13 50 views
5

我正在與Pharo Smalltalk合作。假設您想將自己的軟件包組保存到本地存儲庫中,您知道軟件包前綴爲「MyPrefix」。什麼是正確的信息呢?在代碼中:一次節省幾個蒙蒂塞洛包裝

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

將腳本編寫爲基於Web的存儲庫太困難了嗎?

回答

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: ''. 
1

爲您加載或更新包組用同樣的方法:

您在本博客中找到
Gofer new 
    squeaksource: 'MyProject'; 
    package: 'MyPrefix-Core'; 
    package: 'MyPrefix-Tests'; 
    commit 

更多信息:Gofer — Monticello and Groups of Packages