'From Squeak3.1alpha of 5 February 2001 [latest update: #3527] on 6 February 2001 at 10:41:09 pm'! "Change Set: UpdateMultiTweak Date: 6 February 2001 Author: Dan Ingalls Allows overriding the sequence number when updating non-current versions. "! !ServerDirectory methodsFor: 'updates' stamp: 'di 2/6/2001 22:40'! putUpdateMulti: list fromDirectory: updateDirectory "Put these files out as an Update on the servers of my group. List is an array of local file names without number prefixes. Each version of the system has its own set of update files. 'updates.list' holds the master list. Each update is a fileIn whose name begins with a number. See Utilities class absorbUpdatesFromServer." | myServers updateStrm lastNum myName response restOfText newNames file numStr insertion | (self checkNames: list) ifFalse: [^ nil]. myName _ group ifNil: [self moniker] ifNotNil: [group key]. response _ (PopUpMenu labels: 'Install update\Cancel update' withCRs) startUpWithCaption: 'Do you really want to broadcast ', list size printString, ' updates', '\to every Squeak user who updates from ' withCRs, myName, '?'. response = 1 ifFalse: [^ nil]. "abort" self openGroup. (myServers _ self checkServers) size = 0 ifTrue: [self closeGroup. ^ self]. updateStrm _ myServers first getFileNamed: 'updates.list'. lastNum _ Utilities lastUpdateNum: updateStrm. restOfText _ Utilities position: updateStrm "sets the postion!!!!" atVersion: (Smalltalk at: #EToySystem) version. restOfText size > 0 ifTrue: [ response _ (PopUpMenu labels: 'Make update for my older version\Cancel update' withCRs) startUpWithCaption: 'This system, ', (Smalltalk at: #EToySystem) version, ' is not the latest version'. response = 1 ifFalse: [self closeGroup. ^ nil "abort"]. numStr _ FillInTheBlank request: 'Please confirm or change the starting update number' initialAnswer: (lastNum+1) printString. lastNum _ numStr asNumber - 1]. newNames _ list with: (lastNum+1 to: lastNum+list size) collect: [:each :num | (num printString padded: #left to: 4 with: $0) , each]. insertion _ String streamContents: [:s | newNames do: [:n | s nextPutAll: n; cr]]. "append name to updates" (updateStrm skip: -1; next) = Character cr ifFalse: [ updateStrm nextPut: Character cr]. updateStrm nextPutAll: insertion; nextPutAll: restOfText. myServers do: [:aServer | list doWithIndex: [:local :ind | file _ updateDirectory oldFileNamed: local. aServer putFile: file named: (newNames at: ind) retry: true. file close]. updateStrm reset. aServer putFile: updateStrm named: 'updates.list' retry: true. Transcript cr; show: 'Updates succeeded on server ', aServer moniker]. self closeGroup. Transcript cr; show: 'Be sure to test your new update!!'; cr. "rename the file locally" list with: newNames do: [:local :newName | updateDirectory rename: local toBe: newName]. ! !