author | Claus Gittinger <cg@exept.de> |
Sat, 13 Oct 2018 18:17:08 +0200 | |
changeset 1583 | 825a2629e6d7 |
parent 1473 | f27f36d6a310 |
permissions | -rw-r--r-- |
12 | 1 |
"/ |
2 |
"/ $Header$ |
|
3 |
"/ |
|
656 | 4 |
"/ This file is processed very early at initial startup (before any rc script) |
12 | 5 |
"/ - not when resuming an image. |
6 |
"/ |
|
0 | 7 |
|
656 | 8 |
"/ |
446 | 9 |
"/ set the package for changes done below |
656 | 10 |
"/ |
24 | 11 |
Project notNil ifTrue:[ |
446 | 12 |
|p| |
13 |
||
14 |
p := Project new. |
|
656 | 15 |
p package:#'patches'. |
446 | 16 |
Project current:p. |
24 | 17 |
]. |
174 | 18 |
! |
125 | 19 |
|
672 | 20 |
"/ read patches from two patch-directories, called 'stxPatches' and 'userPatches'. |
21 |
"/ (in the future, patch-sets will be delivered for that directory in the future) |
|
22 |
"/ This is not yet done, but we are prepared here for this ... |
|
23 |
"/ |
|
24 |
"/ Patches from that directory are read in alphabetic order; |
|
358
14a45495e3d8
autoloaded classes must be read after the host.rc file;
Claus Gittinger <cg@exept.de>
parents:
323
diff
changeset
|
25 |
"/ patches will be named them p_nnnn.st, where nnnn is a sequence-nr. |
291
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
26 |
|
1473
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
27 |
"/ Smalltalk splashInfo:'patches [info]: installing patches...'. |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
28 |
|
672 | 29 |
#( |
30 |
'stxPatches' |
|
31 |
'userPatches' |
|
32 |
) do:[:patchDirName | |
|
33 |
|patchDirOrNil patchDir| |
|
291
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
34 |
|
672 | 35 |
patchDirOrNil := Smalltalk getSystemFileName:patchDirName. |
36 |
patchDirOrNil notNil ifTrue:[ |
|
37 |
patchDir := patchDirOrNil asFilename. |
|
38 |
(patchDir exists and:[patchDir isDirectory and:[patchDir isReadable]]) ifTrue:[ |
|
39 |
patchDir directoryContents sort do:[:f | |
|
1252
688c919be522
Do not try to file-in directory when loading patches
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
975
diff
changeset
|
40 |
|file fn| |
291
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
41 |
|
1252
688c919be522
Do not try to file-in directory when loading patches
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
975
diff
changeset
|
42 |
fn := (file := patchDir construct:f) name. |
1256
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
43 |
"JV@2012-08-15: File in only if file is not a directory. Otherwise system |
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
44 |
crashes during startup, if one of the patch directories contains another directory |
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
45 |
(such as CVS)" |
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
46 |
(file isDirectory not and:[file isReadable]) ifTrue:[ |
1473
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
47 |
( #('xxx' 'bak' 'sav') includes:file suffix asLowercase) ifTrue:[ |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
48 |
Smalltalk splashInfo:('patches [info]: skipping file "',fn,'" (wrong suffix)'). |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
49 |
] ifFalse:[ |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
50 |
Smalltalk splashInfo:('patches [info]: reading patch "',fn,'"...'). |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
51 |
AbortOperationRequest handle:[:ex | |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
52 |
Smalltalk splashInfo:('patches [info]: aborted patch "',f,'" (',ex description,')'). |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
53 |
] do:[ |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
54 |
Smalltalk fileIn:fn. |
f27f36d6a310
skip .bak, .sav and .xxx suffixes when reading the patches
Claus Gittinger <cg@exept.de>
parents:
1327
diff
changeset
|
55 |
]. |
1256
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
56 |
]. |
57adb4a406ed
handle abort during read of patches
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
57 |
] |
672 | 58 |
] |
59 |
] |
|
60 |
]. |
|
291
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
61 |
]. |
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
62 |
! |
b6ece4a96c36
preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents:
284
diff
changeset
|
63 |
|
16 | 64 |
"/ |
12 | 65 |
"/ the following patches where added by the changesBrowsers 'make change a patch' |
66 |
"/ function ... |
|
67 |
"/ |
|
210 | 68 |
! |