skip .bak, .sav and .xxx suffixes when reading the patches
authorClaus Gittinger <cg@exept.de>
Thu, 03 Nov 2016 13:57:30 +0100
changeset 1473 f27f36d6a310
parent 1472 125a66fb0d16
child 1474 5da7d89d0cae
skip .bak, .sav and .xxx suffixes when reading the patches
patches
--- a/patches	Fri Oct 14 18:37:04 2016 +0200
+++ b/patches	Thu Nov 03 13:57:30 2016 +0100
@@ -15,8 +15,6 @@
     p package:#'patches'.
     Project current:p.
 ].
-
-Smalltalk splashInfo:'patches [info]: installing patches...'.
 !
 
 "/ read patches from two patch-directories, called 'stxPatches' and 'userPatches'.
@@ -26,6 +24,8 @@
 "/ Patches from that directory are read in alphabetic order;
 "/ patches will be named them p_nnnn.st, where nnnn is a sequence-nr.
 
+"/ Smalltalk splashInfo:'patches [info]: installing patches...'.
+
 #(
     'stxPatches'
     'userPatches'
@@ -44,11 +44,15 @@
 		 crashes during startup, if one of the patch directories contains another directory
 		 (such as CVS)"
 		(file isDirectory not and:[file isReadable]) ifTrue:[
-		    Smalltalk splashInfo:('patches [info]: reading patchFile "' , fn , '"...').
-		    AbortOperationRequest handle:[:ex |
-			Smalltalk splashInfo:('patches [info]: aborted patch "',f,'" (',ex description,')').
-		    ] do:[
-			Smalltalk fileIn:fn.
+		    ( #('xxx' 'bak' 'sav') includes:file suffix asLowercase) ifTrue:[
+			Smalltalk splashInfo:('patches [info]: skipping file "',fn,'" (wrong suffix)').
+		    ] ifFalse:[
+			Smalltalk splashInfo:('patches [info]: reading patch "',fn,'"...').
+			AbortOperationRequest handle:[:ex |
+			    Smalltalk splashInfo:('patches [info]: aborted patch "',f,'" (',ex description,')').
+			] do:[
+			    Smalltalk fileIn:fn.
+			].
 		    ].
 		]
 	    ]