The Trunk: MonticelloConfigurations-dtl.148.mcz

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

The Trunk: MonticelloConfigurations-dtl.148.mcz

commits-2
David T. Lewis uploaded a new version of MonticelloConfigurations to project The Trunk:
http://source.squeak.org/trunk/MonticelloConfigurations-dtl.148.mcz

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

Name: MonticelloConfigurations-dtl.148
Author: dtl
Time: 16 November 2016, 10:12:09.337083 pm
UUID: 5a93ddea-570a-4052-9e9e-09fdcb43dabd
Ancestors: MonticelloConfigurations-bf.147

An update stream is specified by a repository URL and an update map name. If multiple repositories are involved, these are specified in the update maps within the update stream.

Therefore clean up leftover cruft from earlier refactorings, eliminating MCMcmUpdater class>>updateFromRepositories: and related methods because updater instances now know their own repository URL.

Move Andreas original code example for http://squeaksource.com/MCUpdateTest from MCMcmUpdater class>> updateFromRepositories: to MCMcmUpdater class>> updateFromRepository: because updaters are instance based, one repository per updater.

        "MCMcmUpdater updateFromRepository: 'http://squeaksource.com/MCUpdateTest' "

=============== Diff against MonticelloConfigurations-bf.147 ===============

Item was removed:
- ----- Method: MCMcmUpdater class>>updateFromRepositories: (in category 'updating') -----
- updateFromRepositories: repositoryUrls
- "MCMcmUpdater updateFromRepositories: #(
- 'http://squeaksource.com/MCUpdateTest'
- )"
-
- ^ self default updateFromRepositories: repositoryUrls!

Item was changed:
  ----- 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 changed:
  ----- 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 updateMapNamed: baseName repository: updaterUrlKey)
  doUpdate!

Item was changed:
  ----- 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 |
  previousUpdateLevel := SystemVersion current highestUpdate.
  MCFileBasedRepository flushAllCaches.
+ config := self updateFromRepository.
- config := self updateFromRepositories: { self repository }.
  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 added:
+ ----- 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 := MCHttpRepository
+ location: repository
+ user: ''
+ password: ''.
+ MCRepositoryGroup default addRepository: r.
+ r]
+ !

Item was removed:
- ----- Method: MCMcmUpdater>>updateFromRepositories: (in category 'updating') -----
- updateFromRepositories: repositoryUrls
- "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 ].
- ^config!

Item was added:
+ ----- 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: (in category 'updating') -----
- updateFromRepository: repository
-
- | 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|
- 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'.
- "We've loaded all the provided update configurations.
- Use the latest configuration to update all the remaining packages."
- (self useLatestPackagesFrom: repository) ifTrue: [
- config updateFromRepositories.
- config upgrade].
- ]].
- ^ config
- !