[Pkg] Monticello Public: MonticelloConfigurations-ar.53.mcz
squeak-dev-noreply at lists.squeakfoundation.org
squeak-dev-noreply at lists.squeakfoundation.org
Sat Jul 18 03:26:40 UTC 2009
A new version of MonticelloConfigurations was added to project Monticello Public:
http://www.squeaksource.com/mc/MonticelloConfigurations-ar.53.mcz
==================== Summary ====================
Name: MonticelloConfigurations-ar.53
Author: ar
Time: 17 July 2009, 8:26:33 am
UUID: fffdc58b-69ee-bc43-b2ac-e9b96f86dddb
Ancestors: MonticelloConfigurations-mha.42, MonticelloConfigurations-mtf.52
Merge with http://source.squeak.org/trunk.
=============== Diff against MonticelloConfigurations-mtf.52 ===============
Item was changed:
----- Method: MCConfiguration>>name: (in category 'accessing') -----
name: aString
+ "Sets the name of the configuration without extension (.mcm).
+ See also MCMcmReader>>configurationName."
-
- (aString endsWith: self writerClass extension)
- ifTrue: [ ^ name := aString allButLast: self writerClass extension size + 1 ].
name := aString!
Item was changed:
----- Method: MCMcmReader>>version (in category 'accessing') -----
version
+ ^self configuration!
- | configuration |
- stream reset.
- configuration := MCConfiguration fromArray: (MCScanner scan: stream).
- configuration name: self configurationName.
- ^configuration!
Item was added:
+ ----- Method: MCMcmReader>>loadVersionInfo (in category 'accessing') -----
+ loadVersionInfo
+ info := self configuration!
Item was changed:
MCVersionReader subclass: #MCMcmReader
+ instanceVariableNames: 'fileName configuration'
- instanceVariableNames: 'fileName'
classVariableNames: ''
poolDictionaries: ''
category: 'MonticelloConfigurations'!
Item was added:
+ Object subclass: #MCMcmUpdater
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'MonticelloConfigurations'!
Item was added:
+ ----- Method: MCMcmUpdater class>>updateFromRepositories: (in category 'updating') -----
+ updateFromRepositories: repositoryUrls
+ "MCMcmUpdater updateFromRepositories: #(
+ 'http://squeaksource.com/MCUpdateTest'
+ )"
+
+ | repos updateList parts base author version type config |
+ Preferences enable: #upgradeIsMerge.
+
+ "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|
+ updateList := SortedCollection new.
+ "Find all the updates-author.version.mcm files"
+ r allFileNames do:[:versionedName|
+ parts := versionedName findTokens: '.-'.
+ parts size = 4 ifTrue:[
+ base := parts at: 1.
+ author := parts at: 2.
+ version := [(parts at: 3) asNumber] on: Error do:[:ex| ex return: 0].
+ type := parts at: 4.
+ ].
+ (base = 'update' and:[version > 0 and:[type = 'mcm']])
+ ifTrue:[updateList add: version -> versionedName]].
+
+ "Proceed only if there are updates available at all."
+ updateList ifNotEmpty: [
+ "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|
+ config := r versionFromFileNamed: assoc value.
+ (config dependencies allSatisfy:[:dep| dep isFulfilled])
+ ifFalse:[config upgrade]].
+ "We've loaded all the provided update configurations.
+ Use the latest configuration to update all the remaining packages."
+ config updateFromRepositories.
+ config upgrade.
+ ].
+ ].!
Item was added:
+ ----- Method: MCMcmReader>>configuration (in category 'accessing') -----
+ configuration
+ configuration ifNil: [self loadConfiguration].
+ "browser modifies configuration, but the reader might get cached"
+ ^configuration copy!
Item was added:
+ ----- Method: MCMcmReader>>loadConfiguration (in category 'accessing') -----
+ loadConfiguration
+ stream reset.
+ configuration := MCConfiguration fromArray: (MCScanner scan: stream).
+ configuration name: self configurationName.
+ !
More information about the Packages
mailing list