[Pkg] Packages: Sake-Packages-kph.34.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Fri Jul 3 02:40:02 UTC 2009


A new version of Sake-Packages was added to project Packages:
http://www.squeaksource.com/Packages/Sake-Packages-kph.34.mcz

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

Name: Sake-Packages-kph.34
Author: kph
Time: 3 July 2009, 3:40 am
UUID: 56810f94-8da0-4fe2-81ce-8cd9a1dbc7c0
Ancestors: Sake-Packages-kph.33

defaultAction sets hasRun so that appended actions may depend upon this task

=============== Diff against Sake-Packages-kph.33 ===============

Item was changed:
  ----- Method: Packages>>doActionStep: (in category 'as yet unclassified') -----
  doActionStep: priorTasks
  
  	super doActionStep: priorTasks.
  
  	name ifNil: [ ^ self ].
  		
  	 self isUnloading 
  		ifTrue: [ self step: 'Confirm unload: ', self name printString ]
  		ifFalse: [ self step: 'Confirm load: ', self name printString ]!

Item was changed:
  ----- Method: Packages class>>unload: (in category 'public') -----
  unload: aNameOrList
  
+ 	aNameOrList isString ifTrue: [ ^ (self named: aNameOrList) beUnloading run].
- 	aNameOrList isString ifTrue: [ ^ (self providedAt: aNameOrList) beUnloading run].
  	
+ 	^ (aNameOrList collect: [ :ea |  (self named: aNameOrList) beUnloading ]) asTask run
- 	^ (aNameOrList collect: [ :ea |  (self providedAt: aNameOrList) beUnloading ]) asTask run
   !

Item was changed:
  ----- Method: Packages>>dependsOn (in category 'as yet unclassified') -----
  dependsOn
  
  	self isUnloading ifFalse: [ ^ super dependsOn ].
+ 
- 	
  	unloadPriors ifNil: [ self unloadDependsOn: self loadedDependantsUnloadTasks ].
  	
  	^ unloadPriors!

Item was changed:
  ----- Method: Packages>>defaultUnloadAction (in category 'defaults') -----
  defaultUnloadAction
  
+ 	^ [ Installer mc unload: self mcName ]!
- 	Installer mc unload: self mcName!

Item was changed:
  ----- Method: Packages>>doActionEnd (in category 'as yet unclassified') -----
  doActionEnd
  
+ 
- 	self isUnloading ifTrue: [ ^ self ].
  	
  	self class provided in: [ :reg |
+ 		self isUnloading ifTrue: [ ^ reg removeKey: self name ].
+ 	
  		info dependsOn: (self dependsOn collect: [ :ea | ea asString ]).
  		info provides: self provides.
  		info class: self class name.
  		self provides do: [ :each | reg at: each put: info ].
  	].
  
  	self addToPackageInfo.
  	!

Item was changed:
+ ----- Method: Packages>>beUnloading (in category 'defaults') -----
- ----- Method: Packages>>beUnloading (in category 'mode') -----
  beUnloading
  
  	isUnload := true.
+ 	hasRun := false.
+ 	actionBlock := self defaultUnloadAction.!
- 	hasRun := false.!

Item was added:
+ ----- Method: Packages class>>latest: (in category 'public') -----
+ latest: aNameOrList
+ 
+ 	^ (self named: aNameOrList) beLatest run!

Item was changed:
  ----- Method: Packages>>loadedDependants (in category 'as yet unclassified') -----
  loadedDependants
  
+ 	| ds |
  	^ self class provided select: [ :dependant  | 
+ 			ds := dependant dependsOn.
+ 			
+ 			ds ifNil: [ false ] ifNotNil: [ ds includesAnyOf: self provides ] .
- 		 dependant dependsOn includesAnyOf: self provides.
  	].
+ 
+ 
  !

Item was changed:
  ----- Method: Packages>>versionIndefinite (in category 'accessing') -----
  versionIndefinite
  
+ 	(self version last ~= $+) ifTrue: [ version := self version, '+'].
- 	(self version last ~= $+) ifTrue: [ self version: self version, '+'].
  !

Item was changed:
  ----- Method: Packages>>defaultLatestAction (in category 'defaults') -----
  defaultLatestAction
  
+ 	^ [ self info url ifNotNilDo: [ :url | (Installer fromUrl: url) latest install ].
+ 		 self hasRunSet.  ]!
- 	^ [ self info url ifNotNilDo: [ :url | (Installer fromUrl: url) latest install ] ]!

Item was changed:
  ----- Method: Packages>>loadedDependantsUnloadTasks (in category 'as yet unclassified') -----
  loadedDependantsUnloadTasks
  
  	"if the task is the provided one, then we return the provided dependants."
  	
+ 	^ self loadedDependants collect: [ : ea | (self class named: ea name) beUnloading ]!
- 	self loadedDependants in: [ :deps |
- 	
- 		deps ifEmpty: [ ^ #() ].
- 	
- 	 	^ (self class provided at: self name ifAbsent: nil) == self
- 			ifTrue: [ (deps collect: [ :ea | ea copy beUnloading ]) ]
- 			ifFalse: [ (deps collect: [ : ea | (self class named: ea name) beUnloading ]) ]
- 	].!

Item was changed:
  ----- Method: Packages>>defaultAction (in category 'defaults') -----
  defaultAction
  	
+ 	^ [ self info url ifNotNilDo: [ :url |  (Installer fromUrl: url) install  ].
+ 		 self hasRunSet. ]!
- 	^ [ self info url ifNotNilDo: [ :url |  (Installer fromUrl: url) install  ] ]!

Item was changed:
  ----- Method: Packages class>>basicNamed: (in category 'private') -----
  basicNamed: packageName
  	
+ 	^ (self basicNew perform: (self asSelector: packageName)) initialize; yourself!
- 	^ self basicNew perform: (self asSelector: packageName); initialize; yourself!

Item was changed:
  SakeTask subclass: #Packages
+ 	instanceVariableNames: 'unload latest useLatest unloadPriors provides requires name mcName version isUnload'
- 	instanceVariableNames: 'unload latest useLatest unloadPriors provides name mcName version isUnload'
  	classVariableNames: 'Provided'
  	poolDictionaries: ''
  	category: 'Sake-Packages'!
  Packages class
  	instanceVariableNames: 'lastUpdate theUUniverse'!
  
  !Packages commentStamp: 'kph 7/1/2009 03:03' prior: 0!
  Sake/Packages usage:
  
  Definitions Search Path
  ============================
  Packages named: 'PackageName'.
  
  Will obtain a package definition. Subclasses of Packages are searched using the order defined by #findPath which is specified by #priority.
  
  e.g. Packages findPath => {PackagesSqueak310 . PackagesDev . PackagesAll . PackagesSeaside29}
  
  Packages-#priority is used to sort classes like so:
  
  The class with defns for a relevant version (listed in #relevantVersions) => 100
  The class with defns for dev version (PackagesDev) => 400
  The class with defns for all versions (PackagesAll) => 500
  
  Additional package "universes" can define their own priority in order to specify where to appear in the #findPath.
  PackagesSeaside29
  PackagesGjaller
  PackagesBeach
  
  Usage:
  ========
  verbose usage specifying run style.
  
  (Packages named: 'Seaside') run.  " or runQuietly, runStepping, runLogging"
  
  #runStepping , - presents a confirm/debug dialog before each action.
  #run            - default.
  #runQuietly    - auto-confirms any SakeConfirm dialogs.
  #runLogging   - Writes any SakeStop warnings to self log.
  
  default usage:
  
  Packages load: 'Seaside'.
  Packages latest: 'Seaside'. "as above, but use latest versions of everything"
  Packages unload: 'Seaside'.
  
  multiples:
  
  Packages load: #('Seaside' 'Magma' 'Logging')  
  
  Unloading
  ========
  Unloading comes in two variants.
  
  Each package task loaded by Sake/Packages is remembered in the 'provided' list
  If you perform:
  
      Packages unload: 'Seaside' .
  
      Packages unloadStepping: 'Seaside' .
  
  Then the 'historical' unload scripts are used, as defined when the original load tasks were run.
  
  If instead you perform:
  
      (Packages current named: 'Seaside') beUnloading runStepping.
   
  Then the most recently defined unload script will be run.
  
  Note: If packages such as "Magma server" and "Magma client" provides "Magma", then
  
      Packages unload: 'Magma'.
  
  Will unload whichever of the two are loaded.
  ===
  Misc notes...
  
  Universes are using 'instance side' task definition, so the task extensions mechanism does not work in this context.
  
  If a package appears in Packages under an obscure name, it can
  tell the PackageInfo instance what name was used to load it via #mcName:
  
  If a package has a version number with a '+' after it, then 'Packages upgrade' will always attempt to load the latest code, leaving Monticello to determine if there are any code changed that need to be applied.
  
  To generate all of the methods based upon universes definitions:
  	
   	Packages taskGenerateAllUniverses run.
  	or
  	Packages taskGenerateAll  run.!



More information about the Packages mailing list