The Trunk: UpdateStream-ul.9.mcz

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

The Trunk: UpdateStream-ul.9.mcz

commits-2
Levente Uzonyi uploaded a new version of UpdateStream to project The Trunk:
http://source.squeak.org/trunk/UpdateStream-ul.9.mcz

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

Name: UpdateStream-ul.9
Author: ul
Time: 13 March 2017, 3:33:44.46675 pm
UUID: 851a813c-a1cf-4757-92d2-fec2489f1cdf
Ancestors: UpdateStream-pre.8

SortedCollection Whack-a-mole

=============== Diff against UpdateStream-pre.8 ===============

Item was changed:
  ----- Method: FileList>>putUpdate: (in category '*UpdateStream') -----
  putUpdate: fullFileName
  "Put this file out as an Update on the servers."
 
  | names choice |
  self canDiscardEdits ifFalse: [^ self changed: #flash].
+ names := ServerDirectory groupNames.
- names := ServerDirectory groupNames asSortedArray.
  choice := UIManager default chooseFrom: names values: names.
  choice == nil ifTrue: [^ self].
  (ServerDirectory serverInGroupNamed: choice) putUpdate:
  (directory oldFileNamed: fullFileName).
  self volumeListIndex: volListIndex.
  !

Item was changed:
  ----- Method: ServerDirectory class>>groupNames (in category '*UpdateStream-server groups') -----
  groupNames
  "Return the names of all registered groups of servers, including individual servers not in any group."
  "ServerDirectory groupNames"
  | names |
  names := Set new.
  self servers do: [:server |
  names add: server groupName].
+ ^names sorted
- ^names asSortedArray
  !

Item was changed:
  ----- Method: ServerDirectory>>updateInstallVersion: (in category '*UpdateStream-updating') -----
  updateInstallVersion: newVersion
  "For each server group, ask whether we want to put the new version marker (eg 'Squeak2.3') at the end of the file.  Current version of Squeak must be the old one when this is done.
  ServerDirectory new updateInstallVersion: 'Squeak9.9test'
  "
  | myServers updateStrm names choice indexPrefix listContents version versIndex |
+ [names := ServerDirectory groupNames.
- [names := ServerDirectory groupNames asSortedArray.
  choice := UIManager default chooseFrom: names values: names.
  choice == nil]
  whileFalse:
  [indexPrefix := (choice endsWith: '*')
  ifTrue: [(choice findTokens: ' ') first] "special for internal updates"
  ifFalse: ['']. "normal"
  myServers := (ServerDirectory serverInGroupNamed: choice)
  checkServersWithPrefix: indexPrefix
  andParseListInto: [:x | listContents := x].
  myServers size = 0 ifTrue: [^ self].
 
  version := SystemVersion current version.
  versIndex := (listContents collect: [:pair | pair first]) indexOf: version.
  versIndex = 0 ifTrue:
  [^ self inform: 'There is no section in updates.list for your version'].  "abort"
 
  "Append new version to updates following my version"
  listContents := listContents copyReplaceFrom: versIndex+1 to: versIndex with: {{newVersion. {}}}.
  updateStrm := ReadStream on:
  (String streamContents: [:s | UpdateStreamDownloader default writeList: listContents toStream: s]).
 
  myServers do:
  [:aServer | updateStrm reset.
  aServer putFile: updateStrm named: indexPrefix ,'updates.list'.
  Transcript cr; show: indexPrefix ,'updates.list written on server ', aServer moniker].
  self closeGroup]!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>broadcastUpdatesFrom:to:except: (in category 'fetching updates') -----
  broadcastUpdatesFrom: n1 to: n2 except: skipList
  "
  Note:  This method takes its list of files from the directory named 'updates',
  which will have been created and filled by, eg,
  UpdateStreamDownloader readServerUpdatesSaveLocally: true updateImage: true.
  These can then be rebroadcast to any server using, eg,
  UpdateStreamDownloader broadcastUpdatesFrom: 1 to: 9999 except: #(223 224).
  If the files are already on the server, and it is only a matter
  of copying them to the index for a different version, then use...
  (ServerDirectory serverInGroupNamed: 'SqC Internal Updates*')
  exportUpdatesExcept: #().
  "
+ | fileNames names choice file updateDirectory |
- | fileNames fileNamesInOrder names choice file updateDirectory |
  updateDirectory := FileDirectory default directoryNamed: 'updates'.
  fileNames := updateDirectory fileNames select:
  [:n | n first isDigit
  and: [(n initialIntegerOrNil between: n1 and: n2)
  and: [(skipList includes: n initialIntegerOrNil) not]]].
  (file := fileNames select: [:n | (n occurrencesOf: $.) > 1]) size > 0
  ifTrue: [self halt: file first , ' has multiple periods'].
+ fileNames sort:
- fileNamesInOrder := fileNames asSortedCollection:
  [:a :b | a initialIntegerOrNil < b initialIntegerOrNil].
 
+ names := ServerDirectory groupNames.
- names := ServerDirectory groupNames asSortedArray.
  choice := UIManager default chooseFrom: names values: names.
  choice == nil ifTrue: [^ self].
  (ServerDirectory serverInGroupNamed: choice)
+ putUpdateMulti: fileNames fromDirectory: updateDirectory
- putUpdateMulti: fileNamesInOrder fromDirectory: updateDirectory
  !

Item was changed:
  ----- Method: UpdateStreamDownloader class>>fileInFromUpdatesFolder: (in category 'fetching updates') -----
  fileInFromUpdatesFolder: numberList
  "File in a series of updates with the given updates numbers, from the updates folder in the default directory.  The file-ins are done in numeric order, even if numberList was not sorted upon entry.
  This is useful for test-driving the retrofitting of a possibly discontinguous list of updates from an alpha version back to a stable release.
 
  UpdateStreamDownloader fileInFromUpdatesFolder: #(4745 4746 4747 4748 4749 4750 4751 4752 4754 4755 4761 4762 4767 4769).
  "
+ | fileNames file updateDirectory |
- | fileNames fileNamesInOrder file updateDirectory |
  updateDirectory := FileDirectory default directoryNamed: 'updates'.
  fileNames := updateDirectory fileNames select:
  [:n | n first isDigit
  and: [numberList includes: n initialIntegerOrNil]].
  (file := fileNames select: [:n | (n occurrencesOf: $.) > 1]) size > 0
  ifTrue: [self error: file first , ' has multiple periods'].
+ fileNames sort:
- fileNamesInOrder := fileNames asSortedCollection:
  [:a :b | a initialIntegerOrNil < b initialIntegerOrNil].
 
+ fileNames do:
- fileNamesInOrder do:
  [:aFileName | (updateDirectory readOnlyFileNamed: aFileName) fileIntoNewChangeSet]!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>summariesForUpdates:through: (in category 'fetching updates') -----
  summariesForUpdates: startNumber through: stopNumber
  "Answer the concatenation of summary strings for updates numbered in the given range"
 
  ^ String streamContents: [:aStream |
  ((ChangeSet changeSetsNamedSuchThat:
  [:aName | aName first isDigit
  and: [aName initialIntegerOrNil >= startNumber
+ and: [aName initialIntegerOrNil <= stopNumber]]]) sorted:
- and: [aName initialIntegerOrNil <= stopNumber]]]) asSortedCollection:
  [:a :b | a name < b name]) do:
  [:aChangeSet | aStream cr; nextPutAll: aChangeSet summaryString]]
 
  "UpdateStreamDownloader summariesForUpdates: 4899 through: 4903"
 
  !