Frank Shearar uploaded a new version of Installer-Core to project The Inbox:
http://source.squeak.org/inbox/Installer-Core-fbs.362.mcz ==================== Summary ==================== Name: Installer-Core-fbs.362 Author: fbs Time: 25 January 2013, 12:02:28.537 pm UUID: 4e06221a-c7a6-4d1b-9d72-8cbff6d105e2 Ancestors: Installer-Core-bp.360 Installer repository failover #2 of 2: InstallerMonticello uses an MCRepositoryGroup, so that attempting to load a particular version will try each repository in turn. #basicView will open _all_ the InstallerMonticello's repositories. =============== Diff against Installer-Core-bp.360 =============== Item was changed: ----- Method: InstallerMonticello>>cache (in category 'instance creation') ----- cache + | cache | + cache := self classMCCacheRepository default. + mc addRepository: cache. + root := cache directory localName.! - - mc := self classMCCacheRepository default. - root := mc directory localName - ! Item was changed: ----- Method: InstallerMonticello>>directory: (in category 'instance creation') ----- directory: dir - | directory | directory := dir isString ifTrue: [ FileDirectory on: (FileDirectory default fullNameFor: dir) ] ifFalse: [ dir ]. + mc addRepository: (self classMCDirectoryRepository new directory: directory; yourself). - mc := self classMCDirectoryRepository new directory: directory; yourself. root := dir ! Item was changed: ----- Method: InstallerMonticello>>ftp:directory:user:password: (in category 'instance creation') ----- ftp: host directory: dir user: name password: secret "Installer mc ftp: 'mc.gjallar.se' directory: '' user: 'gjallar' password: secret." + mc addRepository: (self classMCFtpRepository host: host directory: dir user: name password: secret; yourself). - mc := self classMCFtpRepository host: host directory: dir user: name password: secret. root := dir. ! Item was changed: ----- Method: InstallerMonticello>>goods:port: (in category 'instance creation') ----- goods: host port: aport + mc addRepository: ((self classMCGOODSRepository new) host: host port: aport; yourself) - mc := (self classMCGOODSRepository new) host: host port: aport; yourself ! Item was changed: ----- Method: InstallerMonticello>>http:user:password: (in category 'instance creation') ----- http: aUrl user: name password: secret + | url http | - | url | url := (aUrl includesSubString: '://') ifTrue: [aUrl] ifFalse: ['http://', aUrl]. + http := self classMCHttpRepository location: url user: name password: secret. + mc addRepository: http. + root := http locationWithTrailingSlash - mc := self classMCHttpRepository location: url user: name password: secret. - root := mc locationWithTrailingSlash ! Item was added: + ----- Method: InstallerMonticello>>initialize (in category 'public interface') ----- + initialize + super initialize. + mc := MCRepositoryGroup new.! Item was changed: ----- Method: InstallerMonticello>>label (in category 'accessing') ----- label + ^ 'repositories: #(', + ((mc repositories allButFirst + collect: [:repo | repo description surroundedBySingleQuotes]) + reduce: [:acc :each | acc, ' ', each]), + ');'.! - ^ 'repository:''', mc description, ''''! Item was changed: ----- Method: InstallerMonticello>>magma:port: (in category 'instance creation') ----- magma: host port: aport + mc addRepository: ((self classMCMagmaRepository new) host: host port: aport; yourself) - mc := (self classMCMagmaRepository new) host: host port: aport; yourself ! Item was changed: ----- Method: InstallerMonticello>>mc (in category 'accessing') ----- mc + "Return the GROUP of Monticello repositories." - ^ mc! Item was changed: ----- Method: InstallerMonticello>>mc: (in category 'accessing') ----- mc: aRepo + mc addRepository: aRepo! - - mc := aRepo! Item was changed: ----- Method: InstallerMonticello>>mcThing (in category 'monticello') ----- mcThing | loader | loader := self classMCVersionLoader new. + - self logCR: 'reading ' , mc description , '...'. "several attempts to read files - repository readableFileNames sometimes fails" self packages do: [:pkg | | versionNames fileToLoad version | versionNames := mc versionNamesForPackageNamed: (pkg asMCVersionName versionNumber = 0 ifTrue: [ "Just a package name specified, use it whole." pkg ] ifFalse: [pkg asMCVersionName packageName]). versionNames sort: self mcSortFileBlock. fileToLoad := versionNames detect: (self mcDetectFileBlock: pkg) ifNone: [ nil ]. fileToLoad ifNotNil: [version := mc versionNamed: fileToLoad. (version isKindOf: MCConfiguration) ifTrue: [^ version] + ifFalse: [self normalizedRepositories do: [:repo | + MCRepositoryGroup default addRepository: repo]. + self normalizedRepositories do: [:repo | + version workingCopy repositoryGroup addRepository: repo]. - ifFalse: [MCRepositoryGroup default addRepository: self normalizedRepository. - version workingCopy repositoryGroup addRepository: self normalizedRepository. loader addVersion: version]. self logCR: ' found ' , version fileName , '...']]. ^ loader! Item was added: + ----- Method: InstallerMonticello>>normalizedRepositories (in category 'monticello') ----- + normalizedRepositories + "Find an existing instance of any active repository so that we use whatever name and password the user usually uses. If not found, answer a copy" + ^ mc repositories replace: [:repo | + (self classMCRepositoryGroup default repositories includes: repo) + ifTrue: [repo] + ifFalse: [repo copy]]! Item was removed: - ----- Method: InstallerMonticello>>normalizedRepository (in category 'monticello') ----- - normalizedRepository - "Find an existing instance of the active repository so that we use whatever name and password the user usually uses. If not found, answer a copy" - - self classMCRepositoryGroup default repositoriesDo: [:ea | - mc = ea ifTrue: [^ ea]]. - ^ mc copy! Item was changed: ----- Method: InstallerMonticello>>project: (in category 'accessing') ----- project: name + | locs dirs all | - project := name. packages := nil. + "mc repositories is a collection of repositories created on the fly. Store a reference to it so we have a stable working set." + all := mc repositories. + "Some repositories point to more specific parts within their structures when given a project name. An HTTP repository adds the project name to its path, for instance. A cache repository, despite being directory based, does not." + locs := all select: [:repo | repo respondsTo: #location:]. + dirs := all select: [:repo | (repo respondsTo: #directory:) and: [(repo respondsTo: #cacheForPackage:) not]]. + locs do: [:repo | + mc removeRepository: repo. + mc addRepository: (repo copy location: root , name)]. + dirs do: [:repo | + mc removeRepository: repo. + mc addRepository: (repo copy directory: root ,'/', name)]. - - (mc respondsTo: #location:) ifTrue:[ mc := mc copy location: root , name ]. - (mc respondsTo: #directory:) ifTrue: [ mc := mc copy directory: root ,'/', name ]. ^self copy.! |
Free forum by Nabble | Edit this page |