The Trunk: SMBase-ul.93.mcz

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

The Trunk: SMBase-ul.93.mcz

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

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

Name: SMBase-ul.93
Author: ul
Time: 12 December 2009, 2:46:41 am
UUID: 95dc9cbb-ba1b-3b43-966e-3e418104115b
Ancestors: SMBase-dtl.92

- replace sends of #ifNotNilDo: to #ifNotNil:, #ifNil:ifNotNilDo: to #ifNil:ifNotNil:, #ifNotNilDo:ifNil: to #ifNotNil:ifNil:

=============== Diff against SMBase-dtl.92 ===============

Item was changed:
  ----- Method: SMPackage>>installedVersion (in category 'printing') -----
  installedVersion
  "Return the version String for the installed version.
  We ask the map. Return nil if this package is not installed."
 
+ ^self installedRelease ifNotNil: [:r | r smartVersion]!
- ^self installedRelease ifNotNilDo: [:r | r smartVersion]!

Item was changed:
  ----- Method: SMInstallationRegistry>>noteInstalledPackageWithId:autoVersion:name: (in category 'installation') -----
  noteInstalledPackageWithId: aPackageId autoVersion: aVersion name: aName
  "The package release was just successfully installed.
  Can be used to inform SM of an installation not been
  done using SM, even when the map isn't loaded.
 
  We record the fact in our Dictionary of installed packages
  and log a 'do it' to mark this in the changelog.
  The doit helps keeping track of the packages when
  recovering changes etc - not a perfect solution but should help.
  The map used is the default map.
  The id of the package is the key and the value is an OrderedCollection
  of Arrays with the release auto version, the point in time and the current installCounter."
 
  | time name id v |
  v := aVersion isString ifTrue: [aVersion asVersion] ifFalse: [aVersion].
  aName ifNil: [name := '<unknown package name>'] ifNotNil: [name := aName].
  id := UUID fromString: aPackageId.
  time := Time totalSeconds.
  self countInstall.
  self markInstalled: id version: v time: time counter: installCounter.
+ (((Smalltalk classNamed: 'SmalltalkImage') ifNotNil: [:si | si current]) ifNil: [Smalltalk])
- (((Smalltalk classNamed: 'SmalltalkImage') ifNotNilDo: [:si | si current]) ifNil: [Smalltalk])
  logChange: '"Installed ', name, ' auto version ', v versionString, '".
  (Smalltalk at: #SMSqueakMap ifAbsent: []) ifNotNil:[
  SMSqueakMap noteInstalledPackageWithId: ', id asString storeString, ' autoVersion: ', v storeString, ' atSeconds: ', time asString, ' number: ', installCounter asString, ']'!

Item was changed:
  ----- Method: SMInstallationRegistry>>noteUninstalledPackageWithId:autoVersion:name: (in category 'installation') -----
  noteUninstalledPackageWithId: aPackageId autoVersion: aVersion name: aName
  "The package release was just successfully uninstalled.
  Can be used to inform SM of an uninstallation not been
  done using SM, even when the map isn't loaded.
 
  We record the fact in our Dictionary of installed packages
  and log a 'do it' to mark this in the changelog.
  The doit helps keeping track of the packages when
  recovering changes etc - not a perfect solution but should help.
  The map used is the default map.
  The id of the package is the key and the value is an OrderedCollection
  of Arrays with the release auto version, the point in time and the current installCounter."
 
  | time name id v |
  v := aVersion isString ifTrue: [aVersion asVersion] ifFalse: [aVersion].
  aName ifNil: [name := '<unknown package name>'] ifNotNil: [name := aName].
  id := UUID fromString: aPackageId.
  time := Time totalSeconds.
  self countInstall. "Used for both installs and uninstalls"
  self clearInstalled: id version: v time: time counter: installCounter.
+ (((Smalltalk classNamed: 'SmalltalkImage') ifNotNil: [:si | si current]) ifNil: [Smalltalk])
- (((Smalltalk classNamed: 'SmalltalkImage') ifNotNilDo: [:si | si current]) ifNil: [Smalltalk])
  logChange: '"Uninstalled ', name, ' auto version ', v versionString, '".
  (Smalltalk at: #SMSqueakMap ifAbsent: []) ifNotNil:[
  SMSqueakMap noteUninstalledPackageWithId: ', id asString storeString, ' autoVersion: ', v storeString, ' atSeconds: ', time asString, ' number: ', installCounter asString, ']'!

Item was changed:
  ----- Method: SMInstaller class>>classForPackageRelease: (in category 'instance creation') -----
  classForPackageRelease: aPackageRelease
  "Decide which subclass to instantiate.
  We detect and return the first subclass
  that wants to handle the release going
  recursively leaf first so that subclasses gets
  first chance if several classes compete over
  the same packages, like for example SMDVSInstaller
  that also uses the .st file extension."
 
  self subclasses do: [:ea |
  (ea classForPackageRelease: aPackageRelease)
+ ifNotNil: [:class | ^ class]].
- ifNotNilDo: [:class | ^ class]].
  ^(self canInstall: aPackageRelease)
  ifTrue: [self]!