patches
author Claus Gittinger <cg@exept.de>
Sun, 19 Jan 2020 16:28:21 +0100
changeset 1620 6437a27b72fc
parent 1473 f27f36d6a310
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
     1
"/
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
     2
"/ $Header$
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
     3
"/
656
33c547d1a706 *** empty log message ***
penk
parents: 488
diff changeset
     4
"/ This file is processed very early at initial startup (before any rc script)
12
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
     5
"/ - not when resuming an image.
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
     6
"/
0
0cb137a77319 Initial revision
claus
parents:
diff changeset
     7
656
33c547d1a706 *** empty log message ***
penk
parents: 488
diff changeset
     8
"/
446
e740c00fb271 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
     9
"/ set the package for changes done below
656
33c547d1a706 *** empty log message ***
penk
parents: 488
diff changeset
    10
"/
24
claus
parents: 21
diff changeset
    11
Project notNil ifTrue:[
446
e740c00fb271 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
    12
    |p|
e740c00fb271 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
    13
e740c00fb271 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
    14
    p := Project new.
656
33c547d1a706 *** empty log message ***
penk
parents: 488
diff changeset
    15
    p package:#'patches'.
446
e740c00fb271 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 397
diff changeset
    16
    Project current:p.
24
claus
parents: 21
diff changeset
    17
].
174
b0336b8ba704 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 173
diff changeset
    18
!
125
82e8b356f5c3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
    19
672
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    20
"/ read patches from two patch-directories, called 'stxPatches' and 'userPatches'.
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    21
"/ (in the future, patch-sets will be delivered for that directory in the future)
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    22
"/ This is not yet done, but we are prepared here for this ...
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    23
"/
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    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
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    29
#(
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    30
    'stxPatches'
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    31
    'userPatches'
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    32
) do:[:patchDirName |
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    33
    |patchDirOrNil patchDir|
291
b6ece4a96c36 preps to read patchFiles from stxPatches directory
Claus Gittinger <cg@exept.de>
parents: 284
diff changeset
    34
672
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    35
    patchDirOrNil := Smalltalk getSystemFileName:patchDirName.
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    36
    patchDirOrNil notNil ifTrue:[
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    37
	patchDir := patchDirOrNil asFilename.
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    38
	(patchDir exists and:[patchDir isDirectory and:[patchDir isReadable]]) ifTrue:[
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    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
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    58
	    ]
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    59
	]
43a67655f4f2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 656
diff changeset
    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
db5d473df9f0 *** empty log message ***
claus
parents: 15
diff changeset
    64
"/
12
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
    65
"/ the following patches where added by the changesBrowsers 'make change a patch'
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
    66
"/ function ...
d8d2f32ca7a2 *** empty log message ***
claus
parents: 11
diff changeset
    67
"/
210
4951ef3afb16 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 196
diff changeset
    68
!