forked from squeak-smalltalk/squeak-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_image.st
77 lines (58 loc) · 2.68 KB
/
prepare_image.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
| smalltalkVersion releaseBuilder monitor |
smalltalkVersion := (Smalltalk argumentAt: 1) ifNil: [''].
FileStream startUp: true. "Reload stdio file handles"
SystemProgressMorph reset.
Utilities setAuthorInitials: 'buildscript'.
TranscriptStream redirectToStdOut: true.
"Avoid showing system progress bar and using graphical tools."
Project current instVarNamed: #uiManager put: DummyUIManager new.
ToolSet default: (Smalltalk at: #CommandLineToolSet).
MCMcmUpdater updateMissingPackages: true.
MCConfiguration upgradeIsMerge: true. "See below"
MCMcmUpdater defaultUpdateURL ifEmpty: [
Error signal: 'There is no update URL set in the image.'].
(NetNameResolver addressForName: 'www.google.com' timeout: 1)
ifNil: [Error signal: 'There is no internet connection available.'].
monitor := [ [
FileStream stdout nextPutAll: '.'.
(Delay forMilliseconds: 5000) wait] repeat ] forkAt: 75.
[[[[
Transcript show: 'Updating...'.
MCMcmUpdater default doUpdate: false.
Transcript show: 'finished.'; cr; showln: SystemVersion current printString.
Transcript showln: 'Checking for modified versions...'.
MCWorkingCopy checkModified: true.
Transcript showln: 'Recompiling...'.
Compiler recompileAll.
] on: ProgressNotification do: [:p | p resume]
] on: Warning do: [:warning | warning resume]
] on: MCNoChangesException do: [:ex | ex resume]
] on: MCMergeResolutionRequest do: [:mrr |
mrr merger conflicts do: [:conflict |
conflict chooseRemote].
mrr resume: true].
"Remove obsolete classes for #testNoObsoleteClasses"
PreferenceViewRegistry removeObsolete.
"Configure image state"
monitor terminate.
monitor := nil.
Transcript showln: 'Reverting update-specific changes...'.
TranscriptStream redirectToStdOut: false.
TranscriptStream forceUpdate: true.
ToolSet default: (Smalltalk at: #StandardToolSet).
Project current instVarNamed: #uiManager put: MorphicUIManager new.
Utilities setAuthorInitials: ''.
FileStream stdout nextPutAll: 'Triggering ReleaseBuilder...'; cr; flush.
releaseBuilder := ((smalltalkVersion beginsWith: 'Etoys')
ifTrue: [Smalltalk classNamed: 'ReleaseBuilderSqueakland']
ifFalse: [ReleaseBuilder]).
releaseBuilder prepareEnvironment.
FileStream stdout nextPutAll: 'Exporting version information for deployment...'; cr; flush.
FileStream fileNamed: 'version.sh' do: [:strm |
strm
nextPutAll: ('SQUEAK_VERSION="{1}"' format: {SystemVersion current version}); lf;
nextPutAll: ('SQUEAK_UPDATE="{1}"' format: {SystemVersion current highestUpdate}); lf;
nextPutAll: ('IMAGE_BITS="{1}"' format: {Smalltalk image wordSize * 8}); lf;
nextPutAll: ('IMAGE_FORMAT="{1}"' format: {Smalltalk image imageFormatVersion}); lf].
FileStream stdout nextPutAll: '[DONE]'; cr; flush.
releaseBuilder saveAndQuit.