From f8a35da251105e156cc1f0c8b484b18badda6f98 Mon Sep 17 00:00:00 2001 From: Max Leske <250711+theseion@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:26:16 +0200 Subject: [PATCH] fix: force load SmalltalkCI in images that already contain it --- gtoolkit/run.sh | 28 ++++++++++++++++++++-------- pharo/run.sh | 28 ++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/gtoolkit/run.sh b/gtoolkit/run.sh index 8f997bfe..28ebd60e 100644 --- a/gtoolkit/run.sh +++ b/gtoolkit/run.sh @@ -176,13 +176,19 @@ gtoolkit::load_project() { metacello := Metacello new baseline: 'SmalltalkCI'; repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")'; - onUpgrade: [ :ex | ex useIncoming ]. + onUpgrade: [ :ex | ex useIncoming ]; + ignoreImage. (Metacello canUnderstand: #onConflictUseIncoming) ifTrue: [ metacello onConflictUseIncoming ] ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ]. - metacello load ] - on: Warning - do: [ :w | w resume ]. + ([ Smalltalk at: #MetacelloIgnorePackageLoaded ] + on: KeyNotFound + do: [ :keyEx | keyEx resumeUnchecked: nil ]) + ifNil: [ metacello load ] + ifNotNil: [ :exceptionClass | + [ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ] + on: Warning + do: [ :w | w resume ]. smalltalkCI := Smalltalk at: #SmalltalkCI. smalltalkCI load: '$(resolve_path "${config_ston}")'. (smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ]) @@ -205,13 +211,19 @@ gtoolkit::test_project() { metacello := Metacello new baseline: 'SmalltalkCI'; repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")'; - onUpgrade: [ :ex | ex useIncoming ]. + onUpgrade: [ :ex | ex useIncoming ]; + ignoreImage. (Metacello canUnderstand: #onConflictUseIncoming) ifTrue: [ metacello onConflictUseIncoming ] ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ]. - metacello load ] - on: Warning - do: [ :w | w resume ]. + ([ Smalltalk at: #MetacelloIgnorePackageLoaded ] + on: KeyNotFound + do: [ :keyEx | keyEx resumeUnchecked: nil ]) + ifNil: [ metacello load ] + ifNotNil: [ :exceptionClass | + [ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ] + on: Warning + do: [ :w | w resume ]. Smalltalk at: #SmalltalkCI ]. smalltalkCI test: '$(resolve_path "${config_ston}")' " diff --git a/pharo/run.sh b/pharo/run.sh index 7284a7b3..33534207 100644 --- a/pharo/run.sh +++ b/pharo/run.sh @@ -367,13 +367,19 @@ pharo::load_project() { metacello := Metacello new baseline: 'SmalltalkCI'; repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")'; - onUpgrade: [ :ex | ex useIncoming ]. + onUpgrade: [ :ex | ex useIncoming ]; + ignoreImage. (Metacello canUnderstand: #onConflictUseIncoming) ifTrue: [ metacello onConflictUseIncoming ] ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ]. - metacello load ] - on: Warning - do: [ :w | w resume ]. + ([ Smalltalk at: #MetacelloIgnorePackageLoaded ] + on: KeyNotFound + do: [ :keyEx | keyEx resumeUnchecked: nil ]) + ifNil: [ metacello load ] + ifNotNil: [ :exceptionClass | + [ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ] + on: Warning + do: [ :w | w resume ]. smalltalkCI := Smalltalk at: #SmalltalkCI. smalltalkCI load: '$(resolve_path "${config_ston}")'. (smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ]) @@ -395,13 +401,19 @@ pharo::test_project() { metacello := Metacello new baseline: 'SmalltalkCI'; repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")'; - onUpgrade: [ :ex | ex useIncoming ]. + onUpgrade: [ :ex | ex useIncoming ]; + ignoreImage. (Metacello canUnderstand: #onConflictUseIncoming) ifTrue: [ metacello onConflictUseIncoming ] ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ]. - metacello load ] - on: Warning - do: [ :w | w resume ]. + ([ Smalltalk at: #MetacelloIgnorePackageLoaded ] + on: KeyNotFound + do: [ :keyEx | keyEx resumeUnchecked: nil ]) + ifNil: [ metacello load ] + ifNotNil: [ :exceptionClass | + [ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ] + on: Warning + do: [ :w | w resume ]. Smalltalk at: #SmalltalkCI ]. smalltalkCI test: '$(resolve_path "${config_ston}")' "