! install OmniBrowser-based tools support.
!
!  expects Monticello to already be loaded.
!
!  expects .mcz files to be found in $GEMSTONE/seaside/monticello/repository
!  or ./seaside/monticello/repository
!
ifError where
errorCount
output push omniBrowserInstall.out only
display resultcheck
errorCount

! install into UserGlobals
run
| policy |
policy := GsPackagePolicy current.
policy homeSymbolDict:  UserGlobals.
policy externalSymbolList: Array new.
true
%

errorCount
commit

run
| basePath dir repository spec |
basePath := GsPackageLibrary getMonticelloRepositoryDirectory .
dir := FileDirectory on: basePath.
repository := MCDirectoryRepository new directory: dir.
MCRepositoryGroup default addRepository: repository.
spec := #[	
    'Announcements.g-dkh.10.mcz', 
       'http://source.lukas-renggli.ch/announcements',
       'http://seaside.gemstone.com/ss/announcements',
    'OmniBrowser-dkh.410.mcz',
       'http://source.wiresong.ca/ob',
       'http://seaside.gemstone.com/ss/GemStone',
    'OB-GemStone-Platform-dkh.42.mcz',
       'http://seaside.gemstone.com/ss/GemStone',
       '',
    'OG-Standard-dkh.74.mcz',
       'http://seaside.gemstone.com/ss/GemStone',
       '',
    'OB-Monticello-dkh.64.mcz',
       'http://source.wiresong.ca/ob',
       '',
    'OB-Tools.g-dkh.79.mcz',
       'http://source.lukas-renggli.ch/omnibrowser',
       'http://seaside.gemstone.com/ss/GemStone',

].
1 to: spec size by: 3 do: [:i | | fileName httpRepository primaryRepository version rg |
    fileName := spec at: i.
    primaryRepository := MCHttpRepository
      location: (spec at: i + 1)
      user: ''
      password: ''.
    (spec at: i + 2) isEmpty not
      ifTrue: [
        httpRepository := MCHttpRepository
          location: (spec at: i + 2)
          user: ''
          password: ''].
    version := repository loadVersionFromFileNamed: fileName.
    version load.
    rg := version workingCopy repositoryGroup.
    rg addRepository: repository.
    rg addRepository: primaryRepository.
    (spec at: i + 2) isEmpty not
      ifTrue: [ rg addRepository: httpRepository ].
].
true
%

errorCount
commit

output pop
errorCount
