|
4 | 4 | ### This file is part of the BBS software (Bioconductor Build System).
|
5 | 5 | ###
|
6 | 6 | ### Author: Hervé Pagès <[email protected]>
|
7 |
| -### Last modification: May 31, 2023 |
| 7 | +### Last modification: Dec 11, 2023 |
8 | 8 | ###
|
9 | 9 |
|
10 | 10 | import sys
|
11 | 11 | import os
|
12 | 12 | import time
|
13 |
| -import urllib.request |
14 | 13 | from functools import lru_cache
|
15 | 14 |
|
16 | 15 | import bbs.fileutils
|
@@ -209,31 +208,6 @@ def getSrcPkgFilesFromSuccessfulSTAGE3(stage_label):
|
209 | 208 | sys.stdout.flush()
|
210 | 209 | return srcpkg_files
|
211 | 210 |
|
212 |
| -def waitForTargetRepoToBeReady(): |
213 |
| - PACKAGES_url = BBSvars.central_base_url + '/src/contrib/PACKAGES' |
214 |
| - nb_attempts = 0 |
215 |
| - while True: |
216 |
| - nb_attempts += 1 |
217 |
| - try: |
218 |
| - f = urllib.request.urlopen(PACKAGES_url) |
219 |
| - except urllib.error.HTTPError: |
220 |
| - print('BBS> [waitForTargetRepoToBeReady]', end=' ') |
221 |
| - print('Unable to access %s. ' % PACKAGES_url + \ |
222 |
| - 'Looks like the target repo is not ready yet!') |
223 |
| - else: |
224 |
| - break |
225 |
| - if nb_attempts == 30: |
226 |
| - print('BBS> [waitForTargetRepoToBeReady]', end=' ') |
227 |
| - print('FATAL ERROR: was unable to access %s after %d attempts. ' % \ |
228 |
| - (PACKAGES_url, nb_attempts) + 'Giving up.') |
229 |
| - sys.exit('=> EXIT.') |
230 |
| - print('BBS> [waitForTargetRepoToBeReady]', end=' ') |
231 |
| - print('-> will wait 3 minutes before trying again ...') |
232 |
| - sys.stdout.flush() |
233 |
| - bbs.jobs.sleep(180.0) |
234 |
| - f.close() |
235 |
| - return |
236 |
| - |
237 | 211 |
|
238 | 212 | ##############################################################################
|
239 | 213 | ## STAGE2: Update ALL packages and re-install target packages + dependencies.
|
@@ -420,7 +394,7 @@ def STAGE2():
|
420 | 394 | # (if it's not ready yet it probably means that the prerun.sh script did
|
421 | 395 | # not finish on the main node, in which case we want to wait before we
|
422 | 396 | # sync the local meat dir with the central MEAT0 dir).
|
423 |
| - waitForTargetRepoToBeReady() |
| 397 | + BBSbase.waitForTargetRepoToBeReady() |
424 | 398 | if not BBSvars.no_transmission:
|
425 | 399 | BBSvars.install_rdir.RemakeMe(True)
|
426 | 400 | if BBSvars.synchronous_transmission:
|
|
0 commit comments