From fe8962e1e76b6f1b4f5b770018a23f41205790d0 Mon Sep 17 00:00:00 2001 From: Offray Date: Wed, 10 Aug 2022 16:56:57 -0500 Subject: [PATCH] Fixing network issues while installing packages via delayed repeated attemps, following Kendrick readme instructions (https://is.gd/nusive) --- src/ExoRepo/ExoRepo.class.st | 43 +++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/ExoRepo/ExoRepo.class.st b/src/ExoRepo/ExoRepo.class.st index b28094d..5b32d0e 100644 --- a/src/ExoRepo/ExoRepo.class.st +++ b/src/ExoRepo/ExoRepo.class.st @@ -10,27 +10,34 @@ Class { { #category : #accessing } ExoRepo >> load [ "I load the configuration of this package using a external Gitea repository." + "While more Git independient providers are implemented in Monticello, I will use Iceberg to download the repository and load it from a local directory" - | localRepo repoName | - - "Sometimes repoName and packageName are different, following Pharo's conventions. - For example the repoName can be MyPackage, while packageName can be My-Package" + + | localRepo repoName count | repoName := self repositoryName. - "Local and remote repo definition" - self local exists ifFalse: [ - (IceRepositoryCreator new - location: self local; - remote: (IceGitRemote url: self repository asString, '.git'); - createRepository) - register - ]. - "Package loading" - localRepo := 'gitlocal://', self local fullName. - ^ Metacello new - repository: localRepo; - baseline: repoName; - load. + self local exists + ifFalse: [ (IceRepositoryCreator new + location: self local; + remote: (IceGitRemote url: self repository greaseString , '.git'); + createRepository) register ]. + localRepo := 'gitlocal://' , self local fullName. + count := 1. + [ true ] + whileTrue: [ [ ^ Metacello new + repository: localRepo; + baseline: repoName; + onConflictUseLoaded; + onWarningLog; + load ] + on: IceGenericError + do: [ :ex | + Notification + signal: (String with: Character cr) , ex description , (String with: Character cr) + , 'RETRYING ' , count greaseString. + (Delay forSeconds: 2) wait. + ex retry ]. + count := count + 1 ] ] { #category : #accessing }