[Pkg] Sake : Sake-Bob-kph.23.mcz
squeak-dev-noreply at lists.squeakfoundation.org
squeak-dev-noreply at lists.squeakfoundation.org
Sat Jul 18 01:28:40 UTC 2009
A new version of Sake-Bob was added to project Sake :
http://www.squeaksource.com/Sake/Sake-Bob-kph.23.mcz
==================== Summary ====================
Name: Sake-Bob-kph.23
Author: kph
Time: 18 July 2009, 2:28:36 am
UUID: 93e0babb-7eec-4db4-81ed-85b8f6462a1e
Ancestors: Sake-Bob-kph.22
adjusted the upload lock
+ asTaskUpload
- silly halt
=============== Diff against Sake-Bob-kph.22 ===============
Item was added:
+ ----- Method: BobBuildImage>>asTaskUpload (in category 'as yet unclassified') -----
+ asTaskUpload
+ ^ self class taskUpload: info build
+
+ !
Item was changed:
----- Method: BobBuildImage>>actionBuild (in category 'as yet unclassified') -----
actionBuild
self linkInProgressDuring: [
self stepAction ifTrue: [ self halt ].
self log bob notice BUILDING: info name.
self expand: (self makeLocal: zipFile) to: (self workingDir mkpath clean).
self startImage: (self workingDir all fileMatching: '*.image').
self linkPackageCache.
self launchVm: self class configVm image: self startImage with: self scriptFileWrite.
self isSuccessfulBuild ifFalse: [ ^ self ].
info timeComplete: DateAndTime now.
info timeDuration: ((info timeComplete - info timeStart) roundTo: 1 second).
self publish.
self package.
self tidy.
self publishLinks.
self log notice BUILDING: info name COMPLETE: true.
].
+ self asTaskUpload perform: runLevel.
- (self class taskUpload: info build) run.
!
Item was changed:
----- Method: BobBuildImage>>isBuildNeeded (in category 'as yet unclassified') -----
isBuildNeeded
"if an explicit build time has been set and not yet reached - dont build"
| dependentFile wait |
+
- (self name includesSubString: '10') ifTrue: [ self halt ].
latest := self infoFileReadLatest.
info when = #interactive ifTrue: [ ^ { false. #interactive. 'Interactive build - run manually' } ].
info when = #manual ifTrue: [ ^ { false. #manual. 'Invoke manually' } ].
((info when isKindOf: DateAndTime) and: [ info when > self timeStart ])
ifTrue: [ ^ { false. #waiting. ('Waiting until ', info when asString). } ].
"if 'when' is set to a file obtain creation time, if not use info image"
"info when = #image."
dependentFile := zipFile := self resolveFile: info image asFile ifNone: [:msg | ^ { false. #inputNotFound. msg.} ].
self info dependentCreationTime: (info imageCreationTime ifNil: [ zipFile creationTime ]).
"has our starting image changed? if so"
(latest dependentCreationTime ~= self info dependentCreationTime)
ifTrue: [
(self dependentFileChanged: dependentFile)
ifTrue: [ ^ { true. #imageChanged. (dependentFile asString , ' has changed').} ]
ifFalse: [ ^ { true. #newStart. (dependentFile asString , ' is ready').} ].
]
ifFalse: [
((true = info when) or: [ info when isFileOrDirectory ]) ifTrue: [ ^ { false. #waitingForChange. ('Waiting for ', dependentFile asString , ' to change').} ]].
"we have a new build id, so we build"
latest build ~= info build ifTrue: [ ^ { true. #newBuildNumber. ('new build number ',info build).} ].
(info when isKindOf: Duration) ifTrue: [
wait := latest startTime + info when - TimeStamp now
wait > 0 ifTrue: [ ^ { false. #waiting. (wait seconds asString, ' seconds to go').} ].
].
"an explicit build time has been given, and this is present existing latest"
((info when isKindOf: DateAndTime) and: [ info when <= latest timeStart ])
ifTrue: [ ^ { false. #done. ((latest package ifNil: [ latest name ]) , ' already built'). } ].
^ { true. #ready. ('building ', self info name). }.
!
Item was changed:
----- Method: BobBuild class>>taskUpload: (in category 'as yet unclassified') -----
taskUpload: metaSelector
"the task of uploading is defined as a top level task, because it is more generic than image building, and may be applied to any result."
| newInfo lock ul dl yes |
^ self define: [ :task |
(task infoFor: metaSelector) ifNil: [ ^ self noop ].
task dependsOn: #().
newInfo := task info.
"obtain and use the latest meta-data from the most recent build activity"
task info: task infoFileReadLatest.
"some fields in the metadata we prefer new values over the older"
task upload: newInfo upload.
task download: newInfo download.
task linkRelease: newInfo linkRelease.
task comment: newInfo comment.
task uploadLatest: newInfo uploadLatest.
task if: [
lock := ul := dl := nil.
yes := task name notNil
and: [ (ul := task isUploadRequested)
and: [ dl := task isUploadedFileAvailableForDownload.
dl ifTrue: [ task uploadDirLock delete ].
dl not and: [ (lock := task uploadDirLock exists) not ] ] ].
task name ifNotNil:[
self log info name: task name uploadRequested: ul done: dl inProgress: lock.
].
- "if we decide that we shall upload, we lock the upload dir to inform others"
- yes ifTrue: [ task uploadDirLock touch ].
yes.
].
task action: [
+ "once we start we lock - until the file is found in the right place, which may be later, since we may be merely initiating the upload"
+ task uploadDirLock touch.
+
+ self log info UPLOADING: task publishDir.
+ task stepAction ifTrue: [ self halt ].
-
- self log info UPLOADING: task publishDir.
- task stepAction ifTrue: [ self halt ].
+ task publishLinkRelease.
- task infoFilesPublishAlongside: task publishDir.
- task publishLinkRelease.
+ task info oneClick = true ifTrue: [ BobOneClickPackageGenerator taskMakeOneClickfor: self build: task info build ].
- task info oneClick = true ifTrue: [ BobOneClickPackageGenerator taskMakeOneClickfor: self build: task info build ].
+ task perform: ('uploadUsing', (task info upload upTo: $:) capitalized) asSymbol.
- task perform: ('uploadUsing', (task info upload upTo: $:) capitalized) asSymbol.
+ task isUploadedFileAvailableForDownload ifTrue: [ task uploadDirLock delete ].
- task isUploadedFileAvailableForDownload ifTrue: [ task uploadDirLock delete ].
]
]
!
Item was removed:
- ----- Method: BobBuild>>uploadDirLockDuring: (in category 'as yet unclassified') -----
- uploadDirLockDuring: aBlock
-
- [ self uploadDirLock touch.
- aBlock value ] ensure: [ self uploadDirLock delete ]
- !
More information about the Packages
mailing list