The Inbox: MonticelloConfigurations-mt.159.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: MonticelloConfigurations-mt.159.mcz

commits-2
Christoph Thiede uploaded a new version of MonticelloConfigurations to project The Inbox:
http://source.squeak.org/inbox/MonticelloConfigurations-mt.159.mcz

==================== Summary ====================

Name: MonticelloConfigurations-mt.159
Author: mt
Time: 18 February 2020, 9:12:46.412015 am
UUID: 0f3711f1-35a6-2542-8c0a-2465bdc516ed
Ancestors: MonticelloConfigurations-dtl.158

Minor spelling/formatting fix in a progress label.

=============== Diff against MonticelloConfigurations-dtl.158 ===============

Item was removed:
- SystemOrganization addCategory: #MonticelloConfigurations!

Item was removed:
- Object subclass: #MCConfiguration
- instanceVariableNames: 'name dependencies repositories log'
- classVariableNames: 'DefaultLog EnsureOpenTranscript ExtraProgressInfo LogToFile UpgradeIsMerge'
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCConfiguration commentStamp: 'dtl 5/10/2010 23:03' prior: 0!
- An MCConfiguration specifies the configuration of a set of related Monticello packages. It maintains an ordered list of package versions and a list of repositories in which the packages may be found.
-
- An MCConfiguration may be filed out for storage as an array specification, and new instances can be created from a stored array specification.
- !

Item was removed:
- ----- Method: MCConfiguration class>>defaultLog (in category 'accessing') -----
- defaultLog
- "Answer the default configuration log"
- ^DefaultLog!

Item was removed:
- ----- Method: MCConfiguration class>>defaultLog: (in category 'accessing') -----
- defaultLog: aStream
- "Set the default configuration log"
- DefaultLog := aStream.!

Item was removed:
- ----- Method: MCConfiguration class>>dependencyFromArray: (in category 'converting') -----
- dependencyFromArray: anArray
- ^MCVersionDependency
- package: (MCPackage named: anArray first)
- info: (
- MCVersionInfo
- name: anArray second
- id: (UUID fromString: anArray third)
- message: nil
- date: nil
- time: nil
- author: nil
- ancestors: nil)!

Item was removed:
- ----- Method: MCConfiguration class>>dependencyToArray: (in category 'converting') -----
- dependencyToArray: aDependency
- ^ {
- aDependency package name .
- aDependency versionInfo name .
- aDependency versionInfo id asString }!

Item was removed:
- ----- Method: MCConfiguration class>>ensureOpenTranscript (in category 'preferences') -----
- ensureOpenTranscript
-
- <preference: 'Ensure Open Transcript'
- category: 'Monticello'
- description: 'When logging, a transcript will be opened automatically if no one is visible. This setting has no effect when logging to a file.'
- type: #Boolean>
-
- ^EnsureOpenTranscript ifNil:[true]!

Item was removed:
- ----- Method: MCConfiguration class>>ensureOpenTranscript: (in category 'preferences') -----
- ensureOpenTranscript: aBoolean
-
- EnsureOpenTranscript := aBoolean.!

Item was removed:
- ----- Method: MCConfiguration class>>extraProgressInfo (in category 'preferences') -----
- extraProgressInfo
- "Answer true for additional progress info during load.
- With the newly added MC down/upload operations this seems unnecessary
- but some people might disagree, so let's leave it as a preference right now"
- <preference: 'Extra Progress Info'
- category: 'Monticello'
- description: 'If true, additional progress information is displayed when loading MC configurations (i.e., during updates)'
- type: #Boolean>
- ^ExtraProgressInfo ifNil:[false]!

Item was removed:
- ----- Method: MCConfiguration class>>extraProgressInfo: (in category 'preferences') -----
- extraProgressInfo: aBool
- "Whether to display for additional progress info during load."
- ExtraProgressInfo := aBool.
- !

Item was removed:
- ----- Method: MCConfiguration class>>fromArray: (in category 'instance creation') -----
- fromArray: anArray
- | configuration |
- configuration := self new.
- anArray pairsDo: [:key :value |
- key = #repository
- ifTrue: [configuration repositories add: (self repositoryFromArray: value)].
- key = #dependency
- ifTrue: [configuration dependencies add: (self dependencyFromArray: value)].
- key = #name
- ifTrue: [configuration name: value].
- ].
- ^configuration!

Item was removed:
- ----- Method: MCConfiguration class>>logToFile (in category 'preferences') -----
- logToFile
- "Whether to log configuration info to files by default.
- If true, logs to a file named after the configuration (config.nn.log).
- If false, logs to the transcript."
- <preference: 'Log config info to disk'
- category: 'Monticello'
- description: 'If true, configuration information (such as change logs) are logged to disk instead of the Transcript. The log file is named after the configuration map (config.nn.log)'
- type: #Boolean>
- ^LogToFile ifNil:[true].!

Item was removed:
- ----- Method: MCConfiguration class>>logToFile: (in category 'preferences') -----
- logToFile: aBool
- "Whether to log configuration info to files by default.
- MCConfiguration logToFile: true.
- MCConfiguration logToFile: false.
- "
- LogToFile := aBool!

Item was removed:
- ----- Method: MCConfiguration class>>repositoryFromArray: (in category 'converting') -----
- repositoryFromArray: anArray
- ^ MCRepositoryGroup default repositories
- detect: [:repo | repo description = anArray first]
- ifNone: [
- MCHttpRepository
- location: anArray first
- user: ''
- password: '']!

Item was removed:
- ----- Method: MCConfiguration class>>repositoryToArray: (in category 'converting') -----
- repositoryToArray: aRepository
- ^ {aRepository description}!

Item was removed:
- ----- Method: MCConfiguration class>>upgradeIsMerge (in category 'preferences') -----
- upgradeIsMerge
- "Answer true if you wish to merge upstream changes whenever you upgrade."
- <preference: 'Upgrade is merge'
- category: 'updates'
- description: 'When upgrading packages, use merge instead of load'
- type: #Boolean>
- ^UpgradeIsMerge ifNil: [true]!

Item was removed:
- ----- Method: MCConfiguration class>>upgradeIsMerge: (in category 'preferences') -----
- upgradeIsMerge: aBoolean
- UpgradeIsMerge := aBoolean.!

Item was removed:
- ----- Method: MCConfiguration>>browse (in category 'actions') -----
- browse
- | browser |
- browser := MCConfigurationBrowser new configuration: self.
- name ifNotNil: [:nm | browser label: browser defaultLabel , ' ' , nm].
- browser show!

Item was removed:
- ----- Method: MCConfiguration>>cacheAllFileNamesDuring: (in category 'private') -----
- cacheAllFileNamesDuring: aBlock
- ^ (repositories
- inject: aBlock
- into: [ :innerBlock :repository |
- [ repository cacheAllFileNamesDuring: innerBlock ]
- ]) value
-
- !

Item was removed:
- ----- Method: MCConfiguration>>changes (in category 'faking') -----
- changes
- ^MCPatch operations: #()!

Item was removed:
- ----- Method: MCConfiguration>>dependencies (in category 'accessing') -----
- dependencies
- ^dependencies ifNil: [dependencies := OrderedCollection new]!

Item was removed:
- ----- Method: MCConfiguration>>dependencies: (in category 'accessing') -----
- dependencies: aCollection
- dependencies := aCollection!

Item was removed:
- ----- Method: MCConfiguration>>depsSatisfying:versionDo:displayingProgress: (in category 'private') -----
- depsSatisfying: selectBlock versionDo: verBlock displayingProgress: progressString
- | count selectedVersions cleanWorkingCopies |
- self cacheAllFileNamesDuring: [
- self repositories do: [ :eachRepository |
- MCRepositoryGroup default addRepository: eachRepository ].
- "First, download selected versions"
- count := 0.
- selectedVersions := OrderedCollection new.
- self withProgress: progressString in: self dependencies do: [ :dep | | verName repo |
- verName := dep versionInfo name.
- self class extraProgressInfo ifTrue:
- [ ProgressNotification signal: '' extra: 'Downloading ' , verName ].
- repo := self repositories
- detect: [ :eachRepository | eachRepository includesVersionNamed: verName ]
- ifNone: [ self logError: 'Version ' , verName , ' not found in any repository'.
- self logError: 'Aborting'.
- ^ count ].
- (selectBlock value: dep) ifTrue: [ | version |
- version := self versionNamed: verName for: dep from: repo.
- version ifNil: [ self logError: 'Could not download version ' , verName , ' from ' , repo description.
- self logError: 'Aborting'.
- ^ count ].
- dep package workingCopy newRepositoryGroupIfDefault. "fix old working copies"
- dep package workingCopy repositoryGroup addRepository: repo.
- selectedVersions add: version]].
- "Then, process only those definitions that moved from one package to another, to avoid order dependence"
- cleanWorkingCopies := MCWorkingCopy allManagers select:
- [ :wc | wc modified not and:
- [ selectedVersions anySatisfy: [ :v | wc package = v package ] ] ].
- MCReorganizationPreloader preloadMovesBetween: selectedVersions.
- "Finally, load/merge selected versions"
- self withProgress: progressString in: selectedVersions do: [ :version |
- self logUpdate: version package with: version.
- self class extraProgressInfo ifTrue:
- [ ProgressNotification signal: '' extra: 'Installing ' , version info name ].
- verBlock value: version.
- count := count + 1 ].
- "Clean up packages made dirty by MCReorganizationPreloader"
- cleanWorkingCopies
- select: [ :wc | wc modified ]
- thenDo: [ :wc | wc checkModified ].
- ].
- ^ count!

Item was removed:
- ----- Method: MCConfiguration>>diffBaseFor: (in category 'private') -----
- diffBaseFor: aDependency
- | wc |
- aDependency package hasWorkingCopy ifFalse: [^nil].
- wc := aDependency package workingCopy.
- wc ancestors ifEmpty: [^nil].
- ^wc ancestors first versionName!

Item was removed:
- ----- Method: MCConfiguration>>fileName (in category 'accessing') -----
- fileName
- ^ self name, '.', self writerClass extension
- !

Item was removed:
- ----- Method: MCConfiguration>>fileOutOn: (in category 'printing') -----
- fileOutOn: aStream
- self writerClass fileOut: self on: aStream!

Item was removed:
- ----- Method: MCConfiguration>>info (in category 'faking') -----
- info
- ^MCVersionInfo new!

Item was removed:
- ----- Method: MCConfiguration>>initialize (in category 'initialize') -----
- initialize
- super initialize.
- log := DefaultLog.!

Item was removed:
- ----- Method: MCConfiguration>>isCacheable (in category 'testing') -----
- isCacheable
- ^false!

Item was removed:
- ----- Method: MCConfiguration>>load (in category 'actions') -----
- load
- ^self depsSatisfying: [:dep | dep isCurrent not]
- versionDo: [:ver | ver load]
- displayingProgress: 'loading packages'
- !

Item was removed:
- ----- Method: MCConfiguration>>log (in category 'accessing') -----
- log
- "Answer the receiver's log. If no log exist use the default log"
-
- ^log ifNil: [
- (name notNil and: [ self class logToFile ]) ifFalse: [
- self class ensureOpenTranscript ifTrue: [Transcript openIfNone].
- ^Transcript ].
- self log: ((FileStream fileNamed: self logFileName) setToEnd; yourself).
- log ]!

Item was removed:
- ----- Method: MCConfiguration>>log: (in category 'accessing') -----
- log: aStream
- log := aStream.!

Item was removed:
- ----- Method: MCConfiguration>>logError: (in category 'private') -----
- logError: aString
- self log
- cr; nextPutAll: 'ERROR: ';
- nextPutAll: aString; cr;
- flush.
- !

Item was removed:
- ----- Method: MCConfiguration>>logFileName (in category 'accessing') -----
- logFileName
-
- ^self name, '-', (FileDirectory localNameFor: Smalltalk imageName), '.log'
- !

Item was removed:
- ----- Method: MCConfiguration>>logUpdate:with: (in category 'private') -----
- logUpdate: aPackage with: aVersion
- self log
- cr; nextPutAll: '========== ', aVersion info name, ' =========='; cr;
- cr; nextPutAll: aVersion info message asString; cr;
- flush.
-
- aPackage hasWorkingCopy ifFalse: [^self].
-
- aPackage workingCopy ancestors do: [:each |
- (aVersion info hasAncestor: each)
- ifTrue: [(aVersion info allAncestorsOnPathTo: each)
- do: [:ver | self log cr; nextPutAll: '>>> ', ver name, ' <<<'; cr;
- nextPutAll: ver message; cr; flush]]]!

Item was removed:
- ----- Method: MCConfiguration>>logWarning: (in category 'private') -----
- logWarning: aString
- self log
- cr; nextPutAll: 'WARNING: ';
- nextPutAll: aString; cr;
- flush.
- !

Item was removed:
- ----- Method: MCConfiguration>>merge (in category 'actions') -----
- merge
- ^self depsSatisfying: [:dep | dep isFulfilledByAncestors not]
- versionDo: [:ver | ver merge]
- displayingProgress: 'merging packages'
- !

Item was removed:
- ----- Method: MCConfiguration>>mustMerge: (in category 'private') -----
- mustMerge: aVersion
- "answer true if we have to do a full merge and false if we can simply load instead"
-
- | pkg wc current |
- (pkg := aVersion package) hasWorkingCopy ifFalse: [^false "no wc -> load"].
- (wc := pkg workingCopy) modified ifTrue: [^true "modified -> merge"].
- wc ancestors isEmpty ifTrue: [^true "no ancestor info -> merge"].
- current := wc ancestors first.
- (aVersion info hasAncestor: current) ifTrue: [^false "direct descendant of wc -> load"].
- "new branch -> merge"
- ^true!

Item was removed:
- ----- Method: MCConfiguration>>name (in category 'accessing') -----
- name
- ^name!

Item was removed:
- ----- Method: MCConfiguration>>name: (in category 'accessing') -----
- name: aString
- name := aString!

Item was removed:
- ----- Method: MCConfiguration>>repositories (in category 'accessing') -----
- repositories
- ^repositories ifNil: [repositories := OrderedCollection new]!

Item was removed:
- ----- Method: MCConfiguration>>repositories: (in category 'accessing') -----
- repositories: aCollection
- repositories := aCollection!

Item was removed:
- ----- Method: MCConfiguration>>setSystemVersion (in category 'updating') -----
- setSystemVersion
- "Set the current system version date to the latest date found in my configuration (or the associated working copy). Also set the highest update number to the sum of version numbers in my configuration."
-
- | versionNumbers versionDates |
- versionNumbers := self dependencies collect: [:d |
- (d versionInfo name copyAfterLast: $.) asInteger].
- versionDates := self dependencies collect: [:d |
- d versionInfo date
- ifNil: [d package workingCopy ancestors first date]].
- SystemVersion current
- date: versionDates max;
- highestUpdate: versionNumbers sum.!

Item was removed:
- ----- Method: MCConfiguration>>storeOn: (in category 'printing') -----
- storeOn: aStream
- aStream nextPut: $(;
- nextPutAll: self class name;
- nextPutAll: ' fromArray: #'.
- self fileOutOn: aStream.
- aStream nextPut: $)!

Item was removed:
- ----- Method: MCConfiguration>>suggestedNameOfNextVersion (in category 'private') -----
- suggestedNameOfNextVersion
- "Suggest a name for the next version of this configuration. The format is assumed to be name-authorInitials.version. Automatically increments the version, takes author initials from Utilities."
- ^'{1}-{2}.{3}' format: {
- name
- ifNil: [ 'newConfiguration' ]
- ifNotNil: [ name asMCVersionName packageName ].
- Utilities authorInitials.
- name
- ifNil: [ 1 ]
- ifNotNil: [ name asMCVersionName versionNumber + 1 ] }!

Item was removed:
- ----- Method: MCConfiguration>>summary (in category 'accessing') -----
- summary
- ^String streamContents: [:stream |
- self dependencies
- do: [:ea | stream nextPutAll: ea versionInfo name; cr ]]!

Item was removed:
- ----- Method: MCConfiguration>>updateFromImage (in category 'updating') -----
- updateFromImage
- self dependencies: (self dependencies collect: [:dep |
- dep package hasWorkingCopy
- ifTrue: [
- dep package workingCopy in: [:wc |
- MCVersionDependency package: wc package info: wc ancestors first]]
- ifFalse: [dep]]).
- !

Item was removed:
- ----- Method: MCConfiguration>>updateFromImage: (in category 'updating') -----
- updateFromImage: packageIndex
- | dep newDeps |
- dep := self dependencies at: packageIndex.
- newDeps := self dependencies copy.
- newDeps
- at: packageIndex put: (dep package hasWorkingCopy
- ifTrue: [dep package workingCopy in: [:wc |
- MCVersionDependency package: wc package info: wc ancestors first]]
- ifFalse: [dep]).
- self dependencies: newDeps.
- !

Item was removed:
- ----- Method: MCConfiguration>>updateFromRepositories (in category 'updating') -----
- updateFromRepositories
-
- self cacheAllFileNamesDuring: [ self updateFromRepositoriesWithoutCaching ]!

Item was removed:
- ----- Method: MCConfiguration>>updateFromRepositories: (in category 'updating') -----
- updateFromRepositories: packageIndex
-
- self cacheAllFileNamesDuring: [ self updateFromRepositoriesWithoutCaching: packageIndex ]!

Item was removed:
- ----- Method: MCConfiguration>>updateFromRepositoriesWithoutCaching (in category 'updating') -----
- updateFromRepositoriesWithoutCaching
-
- | oldNames newNames sortedNames newDeps |
- oldNames := self dependencies collect: [:dep | dep versionInfo versionName].
- newNames := Dictionary new.
- self repositories
- do: [:repo |
- ProgressNotification signal: '' extra: 'Checking ', repo description.
- (repo possiblyNewerVersionsOfAnyOf: oldNames)
- do: [:newName | newNames at: newName put: repo]]
- displayingProgress: 'Searching new versions'.
-
- sortedNames := newNames keys asArray sort:
- [:a :b | a versionNumber > b versionNumber].
-
- newDeps := OrderedCollection new: self dependencies size.
- self dependencies
- do: [:dep |
- newDeps add: (sortedNames
- detect: [:each | each packageAndBranchName = dep packageAndBranchName]
- ifFound: [ :newName |
- | repo |
- repo := newNames at: newName.
- (self versionInfoNamed: newName for: dep from: repo)
- ifNil: [ dep ]
- ifNotNil: [ :info |
- MCVersionDependency package: dep package info: info ] ]
- ifNone: [ dep ]) ]
- displayingProgress: 'downloading new versions'.
-
- self dependencies: newDeps.
- !

Item was removed:
- ----- Method: MCConfiguration>>updateFromRepositoriesWithoutCaching: (in category 'updating') -----
- updateFromRepositoriesWithoutCaching: packageIndex
-
- | oldNames newNames sortedNames newDeps dep |
- dep := dependencies at: packageIndex.
- oldNames := {dep versionInfo versionName}.
- newNames := Dictionary new.
- self repositories
- do: [:repo |
- ProgressNotification signal: '' extra: 'Checking ', repo description.
- (repo possiblyNewerVersionsOfAnyOf: oldNames)
- do: [:newName | newNames at: newName put: repo]]
- displayingProgress: 'Searching new versions'.
-
- sortedNames := newNames keys asArray sort:
- [:a :b | a versionNumber > b versionNumber].
-
- newDeps := self dependencies copy.
- newDeps at: packageIndex put: (
- sortedNames
- detect: [:each | each packageAndBranchName = dep packageAndBranchName]
- ifFound: [ :newName |
- | repo |
- repo := newNames at: newName.
- (self versionInfoNamed: newName for: dep from: repo)
- ifNil: [ dep ]
- ifNotNil: [ :info |
- MCVersionDependency package: dep package info: info ] ]
- ifNone: [ dep ]).
-
- self dependencies: newDeps.
- !

Item was removed:
- ----- Method: MCConfiguration>>upgrade (in category 'actions') -----
- upgrade
- ^self depsSatisfying:
- [:dep | dep isFulfilledByAncestors not]
- versionDo:
- [:ver |
- (self class upgradeIsMerge and: [ver shouldMerge])
- ifFalse: [ver load]
- ifTrue:
- [[ver merge]
- on: MCNoChangesException
- do: [:req| req resume ]
- on: MCMergeResolutionRequest
- do: [:request |
- request merger conflicts isEmpty
- ifTrue: [request resume: true]
- ifFalse: [request pass]]
- on: Deprecation
- do: [:req| req resume ]]]
- displayingProgress: 'upgrading packages'!

Item was removed:
- ----- Method: MCConfiguration>>versionInfoNamed:for:from: (in category 'private') -----
- versionInfoNamed: newName for: dep from: repo
- "Retrieves the version info instead of the version. Searches in-image first, in case the desired version is part of an already loaded package (usual case when doing a partial update). If not present defaults to versionNamed:for:from: an uses its result."
- MCWorkingCopy registry at: dep package ifPresent:[:workingCopy| | seen |
- "Don't use allAncestorsDo: - apparently this can loop indefinitely.
- Rather keep track of the versions that we've seen and make sure we don't loop."
- seen := Set new.
- workingCopy ancestry ancestorsDoWhileTrue:[:vInfo|
- vInfo name = newName ifTrue:[^vInfo].
- (seen includes: vInfo) ifTrue:[false] ifFalse:[seen add: vInfo. false]
- ].
- ].
- ^(self versionNamed: newName for: dep from: repo) info!

Item was removed:
- ----- Method: MCConfiguration>>versionNamed:for:from: (in category 'private') -----
- versionNamed: aMCVersionName for: aDependency from: repo
-
- | baseName fileName ver |
- (repo filterFileNames: repo cachedFileNames forVersionNamed: aMCVersionName) ifNotEmptyDo: [:cachedNames |
- fileName := cachedNames anyOne.
- self class extraProgressInfo
- ifTrue:[ProgressNotification signal: '' extra: 'Using cached ', fileName].
- ver := repo versionNamed: fileName].
- ver ifNil: [
- baseName := self diffBaseFor: aDependency.
- (baseName notNil and: [baseName ~= aMCVersionName and: [repo includesVersionNamed: baseName]]) ifTrue: [
- fileName := (MCDiffyVersion nameForVer: aMCVersionName base: baseName), '.mcd'.
- self class extraProgressInfo
- ifTrue:[ProgressNotification signal: '' extra: 'Downloading ', fileName].
- ver := [repo versionNamed: fileName] ifError: []]].
- ver ifNil: [
- fileName := aMCVersionName versionName, '.mcz'.
- self class extraProgressInfo
- ifTrue:[ProgressNotification signal: '' extra: 'Downloading ', fileName].
- ver := repo versionNamed: fileName].
- ^ver!

Item was removed:
- ----- Method: MCConfiguration>>withProgress:in:do: (in category 'private') -----
- withProgress: progressString in: aCollection do: aBlock
- ^self class extraProgressInfo
- ifTrue: [ aCollection do: aBlock displayingProgress: progressString ]
- ifFalse: [ aCollection do: aBlock ]
-
- !

Item was removed:
- ----- Method: MCConfiguration>>writerClass (in category 'accessing') -----
- writerClass
- ^ MCMcmWriter !

Item was removed:
- MCTool subclass: #MCConfigurationBrowser
- instanceVariableNames: 'configuration dependencyIndex repositoryIndex'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCConfigurationBrowser commentStamp: 'dtl 5/10/2010 21:48' prior: 0!
- A MCConfigurationBrowser displays an MCConfiguration, and edits the configuration to add or remove package dependencies and repository specifications. It allows a configuration to be stored in a repository or posted to an update stream.!

Item was removed:
- ----- Method: MCConfigurationBrowser class>>initialize (in category 'class initialization') -----
- initialize
- TheWorldMenu registerOpenCommand: { 'Monticello Configurations' . { self . #open }. 'Monticello Configuration Browser' }.!

Item was removed:
- ----- Method: MCConfigurationBrowser class>>open (in category 'opening') -----
- open
- ^self new show!

Item was removed:
- ----- Method: MCConfigurationBrowser>>addDependency (in category 'dependencies') -----
- addDependency
- (self pickWorkingCopiesSatisfying: [:each | (self includesPackage: each package) not])
- do: [:wc |
- wc ancestors isEmpty
- ifTrue: [self inform: 'You must save ', wc packageName, ' first!!
- Skipping this package']
- ifFalse: [
- self dependencies add: (MCVersionDependency
- package: wc package
- info: wc ancestors first)]].
- self changed: #dependencyList; changed: #description!

Item was removed:
- ----- Method: MCConfigurationBrowser>>addRepository (in category 'repositories') -----
- addRepository
- (self pickRepositorySatisfying:
- [ : ea | (self repositories includes: ea) not ]) ifNotNil:
- [ : repo | repo class supportsConfigurations ifFalse: [ ^ self inform: 'Not all of these repositories support MCConfigurations.' ].
- self repositories add: repo.
- self changed: #repositoryList ]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>buttonSpecs (in category 'morphic ui') -----
- buttonSpecs
- ^ #(('Add' addDependency 'Add a dependency')
- ('Update' updateMenu 'Update dependencies')
- ('Install' installMenu 'Load/Merge/Upgrade into image')
- ('Up' up 'Move item up in list' canMoveUp)
- ('Down' down 'Move item down in list' canMoveDown)
- ('Remove' remove 'Remove item' canRemove)
- ('Save' store 'Store the configuration to a repository')
- )!

Item was removed:
- ----- Method: MCConfigurationBrowser>>canMoveDown (in category 'testing') -----
- canMoveDown
- ^self index between: 1 and: self maxIndex - 1 !

Item was removed:
- ----- Method: MCConfigurationBrowser>>canMoveUp (in category 'testing') -----
- canMoveUp
- ^self index > 1!

Item was removed:
- ----- Method: MCConfigurationBrowser>>canRemove (in category 'testing') -----
- canRemove
- ^self index > 0!

Item was removed:
- ----- Method: MCConfigurationBrowser>>changedButtons (in category 'selection') -----
- changedButtons
- self changed: #canMoveDown.
- self changed: #canMoveUp.
- self changed: #canRemove.!

Item was removed:
- ----- Method: MCConfigurationBrowser>>changedList (in category 'selection') -----
- changedList
- self dependencyIndex > 0 ifTrue: [^self changed: #dependencyList].
- self repositoryIndex > 0 ifTrue: [^self changed: #repositoryList].
- self error: 'nothing selected'!

Item was removed:
- ----- Method: MCConfigurationBrowser>>checkDependencies (in category 'dependencies') -----
- checkDependencies
- ^self checkModified and: [self checkMissing]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>checkMissing (in category 'dependencies') -----
- checkMissing
- | missing |
- missing := (self dependencies collect:
- [ : ea | ea versionInfo name ]) asSet.
- self repositories do:
- [ : eachRepository | eachRepository cacheAllFileNamesDuring:
- [ missing copy do:
- [ : eachVersionName | (eachRepository includesVersionNamed: eachVersionName) ifTrue: [ missing remove: eachVersionName ] ] ] ].
- ^ missing isEmpty or:
- [ self selectDependency: missing anyOne.
- self confirm:
- (String streamContents:
- [ : strm | strm
- nextPutAll: 'No repository found for' ;
- cr.
- missing do:
- [ : r | strm
- nextPutAll: r ;
- cr ].
- strm nextPutAll: 'Do you still want to store?' ]) ]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>checkModified (in category 'dependencies') -----
- checkModified
- | modified |
- modified := self dependencies select: [:dep |
- dep isFulfilled and: [dep package workingCopy modified]].
-
- ^modified isEmpty or: [
- self selectDependency: modified anyOne.
- self confirm: (String streamContents: [:strm |
- strm nextPutAll: 'These packages are modified:'; cr.
- modified do: [:dep | strm nextPutAll: dep package name; cr].
- strm nextPutAll: 'Do you still want to store?'])]
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>checkRepositories (in category 'repositories') -----
- checkRepositories
- | bad |
- bad := self repositories reject: [:repo | repo class supportsConfigurations ].
- ^bad isEmpty or: [
- self selectRepository: bad first.
- self inform: (String streamContents: [:strm |
- strm nextPutAll: 'Please remove these repositories:'; cr.
- bad do: [:r | strm nextPutAll: r description; cr].
- strm nextPutAll: '(only HTTP repositories are supported)']).
- false].
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>checkRepositoryTemplates (in category 'repositories') -----
- checkRepositoryTemplates
- "unused for now - we only do HTTP"
- | bad |
- bad := self repositories select: [:repo | repo creationTemplate isNil].
- ^bad isEmpty or: [
- self selectRepository: bad first.
- self inform: (String streamContents: [:strm |
- strm nextPutAll: 'Creation template missing for'; cr.
- bad do: [:r | strm nextPutAll: r description; cr].
- strm nextPutAll: 'Please fill in the details first!!']).
- false].
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>configuration (in category 'accessing') -----
- configuration
- ^configuration ifNil: [configuration := MCConfiguration new]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>configuration: (in category 'accessing') -----
- configuration: aConfiguration
- configuration := aConfiguration!

Item was removed:
- ----- Method: MCConfigurationBrowser>>defaultExtent (in category 'morphic ui') -----
- defaultExtent
- ^ 360@500!

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencies (in category 'accessing') -----
- dependencies
- ^self configuration dependencies
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencies: (in category 'accessing') -----
- dependencies: aCollection
- self configuration dependencies: aCollection.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencyIndex (in category 'selection') -----
- dependencyIndex
- ^dependencyIndex ifNil: [0]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencyIndex: (in category 'selection') -----
- dependencyIndex: anInteger
- dependencyIndex := anInteger.
- dependencyIndex > 0
- ifTrue: [self repositoryIndex: 0].
- self changed: #dependencyIndex; changed: #description.
- self changedButtons.!

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencyList (in category 'dependencies') -----
- dependencyList
- ^self dependencies collect: [:dep |
- Text string: dep versionInfo name
- attributes: (Array streamContents: [:attr |
- dep isFulfilledByAncestors
- ifFalse: [attr nextPut: TextEmphasis bold]
- ifTrue: [dep isCurrent ifFalse: [attr nextPut: TextEmphasis italic]].
- ])]
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>dependencyMenu: (in category 'morphic ui') -----
- dependencyMenu: aMenu
- self fillMenu: aMenu fromSpecs: #(('add new dependency...' addDependency)).
- self selectedDependency ifNotNil: [
- self fillMenu: aMenu fromSpecs: #(
- addLine
- ('remove this dependency' remove)
- ('update this dependency from image' updateSelectedDependencyFromImage)
- ('update this dependency from repositories' updateSelectedDependencyFromRepositories)
- )].
- ^aMenu!

Item was removed:
- ----- Method: MCConfigurationBrowser>>description (in category 'description') -----
- description
- self selectedDependency ifNotNil:
- [:dep |
- ^ ('Package: ', dep package name, String cr, dep versionInfo summary) asText].
- self selectedRepository ifNotNil:
- [:repo |
- ^repo creationTemplate
- ifNotNil: [repo creationTemplate asText]
- ifNil: [repo asCreationTemplate asText addAttribute: TextColor red]].
- ^('A configuration is a set of particular versions of packages.  These can be used to manage multiple dependencies amongst packages when an update requires changes to multiple packages.  One stores the current configuration and then modifies the various packages needing modification.  On load, the image will be updated to at least the versions in the current configuration, hence providing the support needed to load the new packages.\\To create a new configuration first load the most up-to-date configuration in your repository (e.g.',  MCHttpRepository trunkUrlString, '), open that repository in the Monticello browser, scroll down to the "update" package, select the first entry in the list on the right hand side and click Browse, which will open the configuration in a new MCConfigurationBrowser.  Then in the new MCConfigurationBrowser click Update, and choose "update all from image" from the pop-up menu.  Click Store to save back to the repository.  If required, one can add reposit
 ories to the browser to store the configuration in a different repository.') withCRs!

Item was removed:
- ----- Method: MCConfigurationBrowser>>description: (in category 'description') -----
- description: aText
-
- self selectedRepository ifNotNil: [:repo |
- | new |
- new := MCRepository readFrom: aText asString.
- (new class = repo class
- and: [new description = repo description])
- ifTrue: [
- repo creationTemplate: aText asString.
- self changed: #description]
- ifFalse: [
- self inform: 'This does not match the previous definition!!'
- ]
- ].
-
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>down (in category 'actions') -----
- down
- self canMoveDown ifTrue: [
- self list swap: self index with: self index + 1.
- self index: self index + 1.
- self changedList.
- ].
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>includesPackage: (in category 'testing') -----
- includesPackage: aPackage
- ^self dependencies anySatisfy: [:each | each package = aPackage]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>index (in category 'selection') -----
- index
- ^self dependencyIndex max: self repositoryIndex!

Item was removed:
- ----- Method: MCConfigurationBrowser>>index: (in category 'selection') -----
- index: anInteger
- self dependencyIndex > 0 ifTrue: [^self dependencyIndex: anInteger].
- self repositoryIndex > 0 ifTrue: [^self repositoryIndex: anInteger].
- anInteger > 0 ifTrue: [self error: 'cannot select']!

Item was removed:
- ----- Method: MCConfigurationBrowser>>installMenu (in category 'actions') -----
- installMenu
- | action |
- action := UIManager default
- chooseFrom: #('load packages' 'merge packages' 'upgrade packages')
- values: #(#load #merge #upgrade).
- action ifNotNil: [self perform: action].!

Item was removed:
- ----- Method: MCConfigurationBrowser>>list (in category 'selection') -----
- list
- self dependencyIndex > 0 ifTrue: [^self dependencies].
- self repositoryIndex > 0 ifTrue: [^self repositories].
- ^#()!

Item was removed:
- ----- Method: MCConfigurationBrowser>>load (in category 'actions') -----
- load
- self configuration load.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>maxIndex (in category 'selection') -----
- maxIndex
- ^ self list size!

Item was removed:
- ----- Method: MCConfigurationBrowser>>merge (in category 'actions') -----
- merge
- self configuration merge.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>pickName (in category 'morphic ui') -----
- pickName
- | name |
- name := UIManager default
- request: 'Name (.', self configuration writerClass extension, ' will be appended):'
- initialAnswer: self configuration suggestedNameOfNextVersion.
- ^ name isEmpty ifFalse: [name]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>pickRepository (in category 'morphic ui') -----
- pickRepository
- ^self pickRepositorySatisfying: [:ea | true]
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>pickRepositorySatisfying: (in category 'morphic ui') -----
- pickRepositorySatisfying: aBlock
- | index list |
- list := MCRepositoryGroup default repositories select: aBlock.
- index := UIManager default chooseFrom: (list collect: [:ea | ea description])
- title: 'Repository:'.
- ^ index = 0 ifFalse: [list at: index]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>pickWorkingCopiesSatisfying: (in category 'morphic ui') -----
- pickWorkingCopiesSatisfying: aBlock
- | copies item |
- copies := (MCWorkingCopy allManagers select: aBlock)
- sort: [:a :b | a packageName <= b packageName].
- item := UIManager default chooseFrom: #('match ...'),(copies collect: [:ea | ea packageName]) lines: #(1) title: 'Package:'.
- item = 1 ifTrue: [
- | pattern |
- pattern := UIManager default request: 'Packages matching:' initialAnswer: '*'.
- ^pattern isEmptyOrNil
- ifTrue: [#()]
- ifFalse: [
- (pattern includes: $*) ifFalse: [pattern := '*', pattern, '*'].
- copies select: [:ea | pattern match: ea packageName]]
- ].
- ^ item = 0
- ifTrue: [#()]
- ifFalse: [{copies at: item - 1}]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>remove (in category 'actions') -----
- remove
- self canRemove ifTrue: [
- self list removeAt: self index.
- self changedList.
- self updateIndex.
- ].
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>removeRepository (in category 'repositories') -----
- removeRepository
- repositoryIndex > 0
- ifTrue: [self repositories removeAt: repositoryIndex.
- repositoryIndex := 0.
- self changed: #repositoryList]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositories (in category 'accessing') -----
- repositories
- ^ self configuration repositories!

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositories: (in category 'accessing') -----
- repositories: aCollection
- ^self configuration repositories: aCollection
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositoryIndex (in category 'selection') -----
- repositoryIndex
- ^repositoryIndex ifNil: [0]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositoryIndex: (in category 'selection') -----
- repositoryIndex: anInteger
- repositoryIndex := anInteger.
- repositoryIndex > 0
- ifTrue: [self dependencyIndex: 0].
- self changed: #repositoryIndex; changed: #description.
- self changedButtons.!

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositoryList (in category 'repositories') -----
- repositoryList
- ^self repositories collect: [:ea | ea description]
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>repositoryMenu: (in category 'morphic ui') -----
- repositoryMenu: aMenu
- self fillMenu: aMenu fromSpecs: #(('add repository...' addRepository)).
- self selectedRepository ifNotNil: [
- self fillMenu: aMenu fromSpecs: #(('remove repository' removeRepository))].
- ^aMenu
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>selectDependency: (in category 'selection') -----
- selectDependency: aDependency
- self dependencyIndex: (self dependencies indexOf: aDependency)!

Item was removed:
- ----- Method: MCConfigurationBrowser>>selectRepository: (in category 'selection') -----
- selectRepository: aRepository
- self repositoryIndex: (self repositories indexOf: aRepository)!

Item was removed:
- ----- Method: MCConfigurationBrowser>>selectedDependency (in category 'dependencies') -----
- selectedDependency
- ^ self dependencies at: self dependencyIndex ifAbsent: []!

Item was removed:
- ----- Method: MCConfigurationBrowser>>selectedPackage (in category 'dependencies') -----
- selectedPackage
- ^ self selectedDependency ifNotNil: [:dep | dep package]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>selectedRepository (in category 'repositories') -----
- selectedRepository
- ^ self repositories at: self repositoryIndex ifAbsent: []!

Item was removed:
- ----- Method: MCConfigurationBrowser>>store (in category 'actions') -----
- store
- (self checkRepositories and: [self checkDependencies]) ifFalse: [^self].
- self pickName ifNotNil: [:name |
- self configuration name: name.
- self pickRepository ifNotNil: [:repo |
- repo storeVersion: self configuration]].!

Item was removed:
- ----- Method: MCConfigurationBrowser>>up (in category 'actions') -----
- up
- self canMoveUp ifTrue: [
- self list swap: self index with: self index - 1.
- self index: self index - 1.
- self changedList.
- ].!

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateFromImage (in category 'updating') -----
- updateFromImage
- self configuration updateFromImage.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateFromRepositories (in category 'updating') -----
- updateFromRepositories
- self configuration updateFromRepositories.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateIndex (in category 'selection') -----
- updateIndex
- self index > 0 ifTrue: [self index: (self index min: self maxIndex)]!

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateMenu (in category 'actions') -----
- updateMenu
- | action |
- action := UIManager default
- chooseFrom: #('update all from image' 'update all from repositories')
- values: #(#updateFromImage #updateFromRepositories).
- action ifNotNil: [self perform: action].!

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateSelectedDependencyFromImage (in category 'actions') -----
- updateSelectedDependencyFromImage
- self configuration updateFromImage: self dependencyIndex.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>updateSelectedDependencyFromRepositories (in category 'actions') -----
- updateSelectedDependencyFromRepositories
- self configuration updateFromRepositories: self dependencyIndex.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>upgrade (in category 'actions') -----
- upgrade
- self configuration upgrade.
- self changed: #dependencyList; changed: #description
- !

Item was removed:
- ----- Method: MCConfigurationBrowser>>widgetSpecs (in category 'morphic ui') -----
- widgetSpecs
- ^ #(
- ((buttonRow) (0 0 1 0) (0 0 0 defaultButtonPaneHeight))
- ((listMorph:selection:menu: dependencyList dependencyIndex dependencyMenu:) (0 0 1 1) (0 defaultButtonPaneHeight 0 -180))
- ((listMorph:selection:menu: repositoryList repositoryIndex repositoryMenu:) (0 1 1 1) (0 -180 0 -120))
- ((textMorph: description) (0 1 1 1) (0 -120 0 0))
- )!

Item was removed:
- ----- Method: MCFileBasedRepository class>>supportsConfigurations (in category '*monticelloconfigurations') -----
- supportsConfigurations
- ^ true!

Item was removed:
- MCVersionReader subclass: #MCMcmReader
- instanceVariableNames: 'fileName configuration'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCMcmReader commentStamp: 'dtl 5/10/2010 22:22' prior: 0!
- A MCMcmReader creates an MCConfiguration by reading an array specification from a stream.
-
- !

Item was removed:
- ----- Method: MCMcmReader class>>extension (in category 'accessing') -----
- extension
- ^ 'mcm'!

Item was removed:
- ----- Method: MCMcmReader class>>loadVersionFile: (in category 'instance creation') -----
- loadVersionFile: fileName
- | version |
- version := self versionFromFile: fileName.
- version load.
- !

Item was removed:
- ----- Method: MCMcmReader class>>on:fileName: (in category 'instance creation') -----
- on: aStream fileName: aFileName
- | reader |
- reader := self on: aStream.
- reader fileName: aFileName.
- ^reader!

Item was removed:
- ----- Method: MCMcmReader>>configuration (in category 'accessing') -----
- configuration
- configuration ifNil: [self loadConfiguration].
- "browser modifies configuration, but the reader might get cached"
- ^configuration copy!

Item was removed:
- ----- Method: MCMcmReader>>fileName: (in category 'accessing') -----
- fileName: aString
- fileName := aString!

Item was removed:
- ----- Method: MCMcmReader>>loadConfiguration (in category 'accessing') -----
- loadConfiguration
- stream reset.
- configuration := MCConfiguration fromArray: (MCScanner scan: stream).
- configuration name ifNil: [ configuration name: self parseNameFromFilename ]!

Item was removed:
- ----- Method: MCMcmReader>>loadVersionInfo (in category 'accessing') -----
- loadVersionInfo
- info := self configuration!

Item was removed:
- ----- Method: MCMcmReader>>parseNameFromFilename (in category 'accessing') -----
- parseNameFromFilename
- ^fileName ifNotNil: [(fileName findTokens: '/\:') last copyUpToLast: $.]!

Item was removed:
- ----- Method: MCMcmReader>>version (in category 'accessing') -----
- version
- ^self configuration!

Item was removed:
- Object subclass: #MCMcmUpdater
- instanceVariableNames: 'repository updateMapName lastUpdateMap'
- classVariableNames: 'DefaultUpdateMap DefaultUpdateURL Registry SkipPackages UpdateFromServerAtStartup UpdateMissingPackages'
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCMcmUpdater commentStamp: 'dtl 10/12/2015 19:45' prior: 0!
- MCMcmUpdater provides utility methods for updating Monticello packages from Monticello configurations.
-
- When Monticello configurations are stored in a repository (or repositories), MCMcmUpdater acts as an update stream. It first ensures that each configuration map has been loaded in sequence, then updates the last configuration map to the most recent version for each specified package, and finally loads these versions to produce a fully updated configuration.
-
- Currently if a set of packages are unloaded from the image, using this class to reload them may cause problems, depending on what dependencies those classes have.  Success is not assured.  Removing packages via SmalltalkImage>>unloadAllKnownPackages will be successful, it flags the packages removed so that they are not loaded by this utility.
-
- If you wish to not have MCMcmUpdater update packages, there are two ways to handle this:
-
- 1) To have MCMcmUpdater not update any packages not currently in the image set the UpdateMissingPackages preference to false:
- MCMcmUpdater updateMissingPackages: false
- Note that any new packages added to the repositories will not be picked up when this is turned off.
- 2) To have MCMcmUpdater not update a specific package, evaluate
- MCMcmUpdater disableUpdatesOfPackage: <packageName>
-
- Class Variables definitions:
-
- DefaultUpdateURL - String: the URL that will be checked by default for updates.  This would be set for a common standard location to check.
-
- Repository - A registry of known MCMcmUpdater instances identified by repository URL and update map name.
-
- SkipPackages - Set of Strings: names of packages to not update in MCMcmUpdater (empty by default).
-
- UpdateMissingPackages - Boolean: if true (default), new packages in the update config map will be loaded unless they are in SkipPackages.  If false, packages not currently loaded in the image will not be loaded by MCMcmUpdater.  (This can be dangerous if packages are split - use at your own risk).
-
- Instance Variables:
-
- updateMapName - Base name of the files used for this updater, typically a name such as 'update' or 'update.spur'.
-
- repository - URL of the repository in which the update maps are located.
-
- lastUpdateMap - Dictionary of Integer: version number of the last loaded update map per repository.  Keeps track of the last configuration map, so that the utility will not have to run through the full history in the repositories each time you ask to update.
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>clearRegistry (in category 'class initialization') -----
- clearRegistry
- "Save the current default updater, clear the registry, and re-register the current updater.
- This is intended for cleaning up an image prior to public release. Assumes that the
- current updater is the one intended for ongoing use in this image."
-
- "MCMcmUpdater clearRegistry"
-
- | current |
- current := self default.
- Registry := nil.
- current register.
- ^Registry!

Item was removed:
- ----- Method: MCMcmUpdater class>>default (in category 'instance creation') -----
- default
- "The default instance for system updates. Uses a default repository and update map
- name that may be set as preferences."
-
- ^self updateMapNamed: self updateMapName repository: self defaultUpdateURL
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>defaultBaseName (in category 'updating') -----
- defaultBaseName
- "If not otherwise specified, look for update maps with this base name"
-
- ^ 'update'!

Item was removed:
- ----- Method: MCMcmUpdater class>>defaultUpdateURL (in category 'preferences') -----
- defaultUpdateURL
- "The default update repository URL"
-
- <preference: 'Update URL'
- category: 'updates'
- description: 'The repository URL for loading updates'
- type: #String>
-
- ^DefaultUpdateURL ifNil:['']!

Item was removed:
- ----- Method: MCMcmUpdater class>>defaultUpdateURL: (in category 'preferences') -----
- defaultUpdateURL: aString
- "The default update repository URL"
-
- DefaultUpdateURL := aString!

Item was removed:
- ----- Method: MCMcmUpdater class>>disableUpdatesOfPackage: (in category 'preferences') -----
- disableUpdatesOfPackage: packageName
- self skipPackages add: packageName!

Item was removed:
- ----- Method: MCMcmUpdater class>>enableUpdatesForAllPackages (in category 'preferences') -----
- enableUpdatesForAllPackages
- SkipPackages := Set new!

Item was removed:
- ----- Method: MCMcmUpdater class>>enableUpdatesOfPackage: (in category 'preferences') -----
- enableUpdatesOfPackage: packageName
- self skipPackages remove: packageName ifAbsent: [].!

Item was removed:
- ----- Method: MCMcmUpdater class>>forRepository:updateMap: (in category 'registry') -----
- forRepository: repository updateMap: basename
- "Answer the requested updater from the repository, or nil of not found"
-
- "MCMcmUpdater forRepository: 'http://source.squeak.org/trunk' updateMap: 'update'"
- "MCMcmUpdater forRepository: 'foo' updateMap: 'bar'"
-
- ^ ((Registry ifNil: [Registry := Dictionary new])
- at: repository
- ifAbsent: [^nil])
- at: basename
- ifAbsent: [^nil]!

Item was removed:
- ----- Method: MCMcmUpdater class>>initialize (in category 'class initialization') -----
- initialize
- "MCMcmUpdater initialize"
-
- DefaultUpdateURL ifNil:[
- DefaultUpdateURL := MCHttpRepository trunkUrlString.
- DefaultUpdateMap := self defaultBaseName.
- ].
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>registry (in category 'registry') -----
- registry
- "Private - unit test support"
- ^Registry!

Item was removed:
- ----- Method: MCMcmUpdater class>>registry: (in category 'registry') -----
- registry: registry
- "Private - unit test support"
- Registry := registry!

Item was removed:
- ----- Method: MCMcmUpdater class>>repository:updateMap: (in category 'instance creation') -----
- repository: urlOrDirectoryPath updateMap: baseName
- "Answer a new instance with empty last update map, not yet registered"
-
- ^ self repository: urlOrDirectoryPath updateMap: baseName lastUpdateMap: Dictionary new!

Item was removed:
- ----- Method: MCMcmUpdater class>>repository:updateMap:lastUpdateMap: (in category 'instance creation') -----
- repository: urlOrDirectoryPath updateMap: baseName lastUpdateMap: dictionary
- "Answer a new instance, not yet registered"
-
- ^ self new
- repository: urlOrDirectoryPath;
- updateMapName: baseName;
- lastUpdateMap: dictionary!

Item was removed:
- ----- Method: MCMcmUpdater class>>skipPackages (in category 'preferences') -----
- skipPackages
- ^SkipPackages ifNil: [SkipPackages := Set new]!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromRepository: (in category 'updating') -----
- updateFromRepository: updaterUrlKey
- "Update using an MCMcmUpdater identified by updaterUrlKey using the default
- update map baseName"
-
- "MCMcmUpdater updateFromRepository: 'http://squeaksource.com/MCUpdateTest' "
-
- ^ self updateFromRepository: updaterUrlKey baseName: self defaultBaseName
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromRepository:baseName: (in category 'updating') -----
- updateFromRepository: updaterUrlKey baseName: baseName
- "Update using an MCMcmUpdater identified by updaterUrlKey, and using
- update map baseName"
-
- "MCMcmUpdater
- updateFromRepository: 'http://squeaksource.com/MCUpdateTest'
- baseName: 'update' "
-
- ^ self updateFromRepository: updaterUrlKey baseName: baseName interactive: true!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromRepository:baseName:interactive: (in category 'updating') -----
- updateFromRepository: updaterUrlKey baseName: baseName interactive: interactive
- "Update using an MCMcmUpdater identified by updaterUrlKey, and using
- update map baseName"
-
- "MCMcmUpdater
- updateFromRepository: 'http://squeaksource.com/MCUpdateTest'
- baseName: 'update'
- interactive: false "
-
- ^ (self updateMapNamed: baseName repository: updaterUrlKey)
- doUpdate: interactive!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromServer (in category 'updating') -----
- updateFromServer
- "Update the image by loading all pending updates from the server."
-
- ^self default doUpdate: true
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromServerAtStartup (in category 'preferences') -----
- updateFromServerAtStartup
- <preference: 'Update from server at startup'
- category: 'updates'
- description: 'If true, the system will check for and load any available updates.'
- type: #Boolean>
- ^ UpdateFromServerAtStartup ifNil: [false].!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromServerAtStartup: (in category 'preferences') -----
- updateFromServerAtStartup: aBool
- "Whether to update the image on startup."
-
- UpdateFromServerAtStartup := aBool.!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateMapName (in category 'preferences') -----
- updateMapName
- "The default update map name"
-
- <preference: 'Update map name'
- category: 'updates'
- description: 'Base name for the update maps'
- type: #String>
-
- ^DefaultUpdateMap ifNil:['']!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateMapName: (in category 'preferences') -----
- updateMapName: mapName
- "The default update map name for the default updater."
-
- DefaultUpdateMap := mapName!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateMapNamed:repository: (in category 'instance creation') -----
- updateMapNamed: baseName repository: urlOrDirectoryPath
- "Answer an instance for the given repository URL with a base update name baseName,
- Register a new instance if not present in the registry."
-
- " | updater1 updater2 |
- updater1 := self updateMapNamed: 'BAR' repository: 'FOO'.
- updater2 := self updateMapNamed: 'BAZ' repository: 'FOO'.
- updater1 unregister.
- updater2 unregister.
- Registry"
-
- ^(self forRepository: urlOrDirectoryPath updateMap: baseName)
- ifNil: [ "register a new updater"
- (self repository: urlOrDirectoryPath updateMap: baseName) register].
-
- !

Item was removed:
- ----- Method: MCMcmUpdater class>>updateMissingPackages (in category 'preferences') -----
- updateMissingPackages
- "Whether to update missing (unloaded) packages"
-
- <preference: 'Update missing package'
- category: 'updates'
- description: 'If true, missing (unloaded) packages will be loaded during the update process.'
- type: #Boolean>
-
- ^UpdateMissingPackages ifNil:[true]!

Item was removed:
- ----- Method: MCMcmUpdater class>>updateMissingPackages: (in category 'preferences') -----
- updateMissingPackages: aBool
- "Whether to update missing (unloaded) packages"
-
- UpdateMissingPackages := aBool.!

Item was removed:
- ----- Method: MCMcmUpdater>>doUpdate: (in category 'updating') -----
- doUpdate: interactive
- "Update the image by loading all pending updates from the server. If this is
- the default updater for the system, update the system version when complete.
- If interteractive use a modal notifier, otherwise only update the transcript.
- Flush all caches. If a previous download failed this is often helpful"
-
- | config previousUpdateLevel ensureTranscriptSetting |
- previousUpdateLevel := SystemVersion current highestUpdate.
- MCFileBasedRepository flushAllCaches.
- ensureTranscriptSetting := MCConfiguration ensureOpenTranscript.
- [ MCConfiguration ensureOpenTranscript: interactive.
- config := self updateFromRepository.
- config ifNil: [
- interactive ifTrue: [ ^self inform: 'Unable to retrieve updates from remote repository.' translated ].
- Transcript cr; show: '==========  Unable to retrieve updates from remote repository. ==========' translated; cr.
- ^ self ].
- MCMcmUpdater default == self
- ifTrue: [
- config setSystemVersion.
- interactive ifTrue: [
- self inform: ('Update completed.\\Version: {1}\Update: {3}{2}\\Url: {4}\Map: ''{5}''{6}' translated withCRs format: {
- SystemVersion current version.
- SystemVersion current highestUpdate.
- previousUpdateLevel = SystemVersion current highestUpdate
- ifTrue: ['']
- ifFalse: [previousUpdateLevel asString, ' -> '].
- self repository.
- MCMcmUpdater updateMapName.
- SystemVersion current description ifEmpty: [''] ifNotEmpty: [:d | String cr, String cr, d]})].
- Transcript cr;
- show: '==========  Update completed:  ' translated;
- show: previousUpdateLevel;
- show: ' -> ' ;
- show: SystemVersion current highestUpdate;
- show: ' =========='; cr ]
- ifFalse: [
- interactive
- ifTrue: [ self inform: 'Update completed.' ].
- Transcript cr; show: '==========  Update completed. ==========' translated; cr ] ]
- ensure: [ MCConfiguration ensureOpenTranscript: ensureTranscriptSetting].
-
- !

Item was removed:
- ----- Method: MCMcmUpdater>>doUpdate:upTo: (in category 'updating') -----
- doUpdate: interactive upTo: versionNumber
- "Update the image by loading all pending updates from the server. If this is
- the default updater for the system, update the system version when complete.
- If interteractive use a modal notifier, otherwise only update the transcript.
- Flush all caches. If a previous download failed this is often helpful"
-
- | config previousUpdateLevel |
- previousUpdateLevel := SystemVersion current highestUpdate.
- MCFileBasedRepository flushAllCaches.
- config := self updateFromRepositories: { self repository } upTo: versionNumber.
- config ifNil: [
- interactive ifTrue: [ ^self inform: 'Unable to retrieve updates from remote repository.' translated ].
- Transcript cr; show: '==========  Unable to retrieve updates from remote repository. ==========' translated; cr.
- ^ self ].
- MCMcmUpdater default == self
- ifTrue: [
- config setSystemVersion.
- interactive ifTrue: [
- self inform: ('Update completed.\\Version: {1}\Update: {3}{2}\\Url: {4}\Map: ''{5}''{6}' translated withCRs format: {
- SystemVersion current version.
- SystemVersion current highestUpdate.
- previousUpdateLevel = SystemVersion current highestUpdate
- ifTrue: ['']
- ifFalse: [previousUpdateLevel asString, ' -> '].
- self repository.
- MCMcmUpdater updateMapName.
- SystemVersion current description ifEmpty: [''] ifNotEmpty: [:d | String cr, String cr, d]})].
- Transcript cr;
- show: '==========  Update completed:  ' translated;
- show: previousUpdateLevel;
- show: ' -> ' ;
- show: SystemVersion current highestUpdate;
- show: ' =========='; cr ]
- ifFalse: [
- interactive
- ifTrue: [ self inform: 'Update completed.' ].
- Transcript cr; show: '==========  Update completed. ==========' translated; cr ]
- !

Item was removed:
- ----- Method: MCMcmUpdater>>doUpdateUpTo: (in category 'updating') -----
- doUpdateUpTo: versionNumber
- "Update the image by loading all pending updates from the server. If this is
- the default updater for the system, update the system version when complete.
- Flush all caches. If a previous download failed this is often helpful"
-
- ^self doUpdate: true upTo: versionNumber
- !

Item was removed:
- ----- Method: MCMcmUpdater>>getRepositoryFromRepositoryGroup (in category 'private') -----
- getRepositoryFromRepositoryGroup
- "Answer the repository for this updater, ensuring that it is registered in the default MCRepositoryGroup"
-
- ^ MCRepositoryGroup default repositories
- detect: [:r | r description = repository]
- ifNone: [| r |
- r := self repositoryAt: repository.
- MCRepositoryGroup default addRepository: r.
- r]
- !

Item was removed:
- ----- Method: MCMcmUpdater>>isRegistered (in category 'registry') -----
- isRegistered
- "True if this instance is registered. False if another instance with the same
- repository and updateNameName is registered."
-
- ^self == ((Registry
- at: repository
- ifAbsent: [^false])
- at: updateMapName
- ifAbsent: [^false]).
-
- !

Item was removed:
- ----- Method: MCMcmUpdater>>lastUpdateMap (in category 'accessing') -----
- lastUpdateMap
-
- ^ lastUpdateMap ifNil: [ lastUpdateMap := Dictionary new ]
- !

Item was removed:
- ----- Method: MCMcmUpdater>>lastUpdateMap: (in category 'accessing') -----
- lastUpdateMap: aDictionary
-
- lastUpdateMap := aDictionary
- !

Item was removed:
- ----- Method: MCMcmUpdater>>printOn: (in category 'printing') -----
- printOn: aStream
-
- super printOn: aStream.
- aStream nextPutAll: ' on ''';
- nextPutAll: updateMapName asString;
- nextPutAll:  ''' at ';
- nextPutAll: repository asString!

Item was removed:
- ----- Method: MCMcmUpdater>>refreshUpdateMapFor:with: (in category 'updating') -----
- refreshUpdateMapFor: r with: updateList
- "Update the lastUpdateMap and answer a possibly reduced updateList"
-
- | config |
- (lastUpdateMap at: r description ifAbsent: [0]) = 0 ifTrue: [
- "No update has ever been loaded from this repo. If no package is
- present in the image either, we can skip right to the latest config"
- config := r versionNamed: updateList last value.
- (config dependencies anySatisfy: [:dep | dep package hasWorkingCopy])
- ifFalse: [(self useLatestPackagesFrom: r)
- ifTrue: [lastUpdateMap at: r description put: updateList last key].
- updateList isEmpty
- ifTrue: [^ #()]
- ifFalse: [^ updateList last: 1]]].
- ^ updateList
- !

Item was removed:
- ----- Method: MCMcmUpdater>>register (in category 'registry') -----
- register
- "Register this instance, keyed by repository and update map name. Each update
- maintains its own lastUpdateMap. The registry permits multilple updaters to be
- maintained, with each updater keeping track of its own last update map."
-
- repository ifNil: [self error: 'repository is ', repository asString].
- updateMapName ifNil: [self error: 'updateMapName is ', updateMapName asString].
- updateMapName isEmpty ifTrue:  [self error: 'updateMapName must be specified'].
- ((Registry ifNil: [Registry := Dictionary new])
- at: repository
- ifAbsentPut: [Dictionary new])
- at: updateMapName put: self
-
- !

Item was removed:
- ----- Method: MCMcmUpdater>>repository (in category 'accessing') -----
- repository
- "URL string of the repository for the update maps"
-
- ^ repository!

Item was removed:
- ----- Method: MCMcmUpdater>>repository: (in category 'accessing') -----
- repository: urlOrDirectoryPath
-
- repository := urlOrDirectoryPath!

Item was removed:
- ----- Method: MCMcmUpdater>>repositoryAt: (in category 'private') -----
- repositoryAt: urlOrDirectoryPath
- "Answer a repository, assuming that urlOrDirectoryPath represents
- either an HTTP repository or a local directory repository. The common
- case is an HTTP repository, but a local repository may be useful for
- testing an update stream prior to posting the update maps to a public
- location."
-
- (FileDirectory default directoryExists: urlOrDirectoryPath)
- ifTrue: [^ MCDirectoryRepository path: urlOrDirectoryPath]
- ifFalse: [^ MCHttpRepository
- location: repository
- user: ''
- password: '']
- !

Item was removed:
- ----- Method: MCMcmUpdater>>skipPackages (in category 'private') -----
- skipPackages
- ^SkipPackages ifNil: [SkipPackages := Set new]!

Item was removed:
- ----- Method: MCMcmUpdater>>unregister (in category 'registry') -----
- unregister
- "If this instance is registered, remove it frorm the registry."
-
- self isRegistered
- ifTrue: [(Registry at: repository) removeKey: updateMapName.
- (Registry at: repository) isEmpty
- ifTrue: [Registry removeKey: repository]]
- !

Item was removed:
- ----- Method: MCMcmUpdater>>updateFromConfig: (in category 'updating') -----
- updateFromConfig: config
-
- "Skip packages that were specifically unloaded"
- config dependencies: (config dependencies
- reject: [:dep| self class skipPackages includes: dep package name]).
- self class updateMissingPackages ifFalse:[
- "Skip packages that are not in the image"
- config dependencies: (config dependencies
- select: [:dep| dep package hasWorkingCopy])].
- (config dependencies allSatisfy:[:dep| dep isFulfilled])
- ifFalse:[config upgrade].
- !

Item was removed:
- ----- Method: MCMcmUpdater>>updateFromRepositories:upTo: (in category 'updating') -----
- updateFromRepositories: repositoryUrls upTo: versionNumber
- "MCMcmUpdater updateFromRepositories: #(
- 'http://squeaksource.com/MCUpdateTest'
- )"
-
- | repos config |
- MCConfiguration upgradeIsMerge: true.
- "The list of repositories to consult in order"
- repos := repositoryUrls collect:[:url|
- MCRepositoryGroup default repositories
- detect:[:r| r description = url]
- ifNone:[ | r |
- r := MCHttpRepository location: url user: '' password: ''.
- MCRepositoryGroup default addRepository: r.
- r]].
-
- "The list of updates-author.version.mcm sorted by version"
- repos do:[ :r | config := self updateFromRepository: r upTo: versionNumber].
- ^config!

Item was removed:
- ----- Method: MCMcmUpdater>>updateFromRepository (in category 'updating') -----
- updateFromRepository
-
- | config repo |
- repo := self getRepositoryFromRepositoryGroup.
- repo cacheAllFileNamesDuring: [ | updateList |
- updateList := self updateListFor: repo.
- "Proceed only if there are updates available at all."
- updateList ifNotEmpty: [
- updateList := self refreshUpdateMapFor: repo with: updateList.
- "Now process each update file. Check if we have all dependencies and if not,
- load the entire configuration (this is mostly to skip older updates quickly)"
- updateList do:[:assoc|
- ProgressNotification signal: '' extra: 'Processing ', assoc value.
- config := repo versionNamed: assoc value.
- self updateFromConfig: config.
- self lastUpdateMap at: repo description put: assoc key.
- ] displayingProgress: 'Processing configurations'.
- "We've loaded all the provided update configurations.
- Use the latest configuration to update all the remaining packages."
- (self useLatestPackagesFrom: repo) ifTrue: [
- config updateFromRepositories.
- config upgrade].
- ]].
- ^ config
- !

Item was removed:
- ----- Method: MCMcmUpdater>>updateFromRepository:upTo: (in category 'updating') -----
- updateFromRepository: repository upTo: versionNumber
-
- | config |
- repository cacheAllFileNamesDuring: [ | updateList |
- updateList := self updateListFor: repository.
- "Proceed only if there are updates available at all."
- updateList ifNotEmpty: [
- updateList := self refreshUpdateMapFor: repository with: updateList.
- "Now process each update file. Check if we have all dependencies and if not,
- load the entire configuration (this is mostly to skip older updates quickly)"
- updateList do:[:assoc|
- assoc key > versionNumber ifTrue: [^config].
- ProgressNotification signal: '' extra: 'Processing ', assoc value.
- config := repository versionNamed: assoc value.
- self updateFromConfig: config.
- self lastUpdateMap at: repository description put: assoc key.
- ] displayingProgress: 'Processing configurations'.
- ]].
- ^config
- !

Item was removed:
- ----- Method: MCMcmUpdater>>updateListFor: (in category 'private') -----
- updateListFor: repo
-
- | updateList allNames minVersion |
- updateList := OrderedCollection new.
- minVersion := self lastUpdateMap at: repo description ifAbsent: [0].
- "Find all the update-*.mcm files"
- allNames := 'Checking ', repo description
- displayProgressFrom: 0 to: 1 during: [:bar|
- bar value: 0.
- repo allFileNamesOrCache ].
- allNames do: [:fileName | | version |
- ((fileName endsWith: '.mcm')
- and: [fileName packageAndBranchName = self updateMapName
- and: [(version := fileName versionNumber) >= minVersion]])
- ifTrue: [updateList add: version -> fileName]].
- ^updateList sort!

Item was removed:
- ----- Method: MCMcmUpdater>>updateMapName (in category 'accessing') -----
- updateMapName
- "Name for update map, without version info"
-
- ^ updateMapName ifNil: [updateMapName := self class updateMapName]!

Item was removed:
- ----- Method: MCMcmUpdater>>updateMapName: (in category 'accessing') -----
- updateMapName: aString
- "Name for update map, without version info"
- updateMapName := aString!

Item was removed:
- ----- Method: MCMcmUpdater>>useLatestPackagesFrom: (in category 'private') -----
- useLatestPackagesFrom: repo
- "for overriding on a per repository basis"
- ^true!

Item was removed:
- MCWriter subclass: #MCMcmWriter
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCMcmWriter commentStamp: 'dtl 5/10/2010 22:20' prior: 0!
- An MCMcmWriter stores an MCConfiguration on a stream in the form of an array specification.
- !

Item was removed:
- ----- Method: MCMcmWriter class>>fileOut:on: (in category 'writing') -----
- fileOut: aConfiguration on: aStream
- | inst |
- inst := self on: aStream.
- inst writeConfiguration: aConfiguration.
- inst close.
-
- !

Item was removed:
- ----- Method: MCMcmWriter class>>readerClass (in category 'accessing') -----
- readerClass
- ^ MCMcmReader!

Item was removed:
- ----- Method: MCMcmWriter>>close (in category 'writing') -----
- close
- stream close!

Item was removed:
- ----- Method: MCMcmWriter>>writeConfiguration: (in category 'writing') -----
- writeConfiguration: aConfiguration
-
- stream nextPut: $(.
-
- aConfiguration name ifNotNil: [:n |
- stream cr.
- stream nextPutAll: 'name '.
- stream print: n].
-
- aConfiguration repositories do: [:ea |
- stream cr.
- stream nextPutAll: 'repository '.
- (MCConfiguration repositoryToArray: ea) printElementsOn: stream].
-
- aConfiguration dependencies do: [:ea |
- stream cr.
- stream nextPutAll: 'dependency '.
- (MCConfiguration dependencyToArray: ea) printElementsOn: stream].
-
- stream cr.
- stream nextPut: $).
- !

Item was removed:
- RWBinaryOrTextStream subclass: #MCPseudoFileStream
- instanceVariableNames: 'localName'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'MonticelloConfigurations'!
-
- !MCPseudoFileStream commentStamp: '<historical>' prior: 0!
- A pseudo file stream which can be used for updates.!

Item was removed:
- ----- Method: MCPseudoFileStream>>localName (in category 'accessing') -----
- localName
- ^localName!

Item was removed:
- ----- Method: MCPseudoFileStream>>localName: (in category 'accessing') -----
- localName: aString
- localName := aString!

Item was removed:
- ----- Method: MCRepository class>>supportsConfigurations (in category '*monticelloconfigurations') -----
- supportsConfigurations
- ^ false!

Item was removed:
- (PackageInfo named: 'MonticelloConfigurations') postscript: '"below, add code to be run after the loading of this package"
- MCConfiguration upgradeIsMerge: Preferences upgradeIsMerge.'!