Factor out the function that moves extension modules to a separate destdir
Stefano Rivera
1 year, 8 months ago
329 | 329 | raise Exception(msg) |
330 | 330 | return result |
331 | 331 | |
332 | def move_to_ext_destdir(i, version, context): | |
333 | """Move built C extensions from the general destdir to ext_destdir""" | |
334 | ext_destdir = get_option('ext_destdir', i, version) | |
335 | if ext_destdir: | |
336 | move_matching_files(context['destdir'], ext_destdir, | |
337 | get_option('ext_pattern', i, version), | |
338 | get_option('ext_sub_pattern', i, version), | |
339 | get_option('ext_sub_repl', i, version)) | |
340 | ||
332 | 341 | func = None |
333 | 342 | if cfg.clean_only: |
334 | 343 | func = plugin.clean |
373 | 382 | if step not in ('build', 'test'): |
374 | 383 | exit(13) |
375 | 384 | if step == 'install': |
376 | ext_destdir = get_option('ext_destdir', i, version) | |
377 | if ext_destdir: | |
378 | move_matching_files(c['destdir'], ext_destdir, | |
379 | get_option('ext_pattern', i, version), | |
380 | get_option('ext_sub_pattern', i, version), | |
381 | get_option('ext_sub_repl', i, version)) | |
385 | move_to_ext_destdir(i, version, c) | |
382 | 386 | if failure: |
383 | 387 | # exit with a non-zero return code if at least one build/test failed |
384 | 388 | exit(13) |
412 | 416 | run(plugin.build, i, version, c) |
413 | 417 | if not is_disabled('install', i, version): |
414 | 418 | run(plugin.install, i, version, c) |
415 | ext_destdir = get_option('ext_destdir', i, version) | |
416 | if ext_destdir: | |
417 | move_matching_files(c['destdir'], ext_destdir, | |
418 | get_option('ext_pattern', i, version), | |
419 | get_option('ext_sub_pattern', i, version), | |
420 | get_option('ext_sub_repl', i, version)) | |
419 | move_to_ext_destdir(i, version, c) | |
421 | 420 | if not nocheck and not is_disabled('test', i, version): |
422 | 421 | run(plugin.test, i, version, c) |
423 | 422 | except Exception as err: |