From 5f79593f3d3c4b0dd56b7438de032746f0b07bb2 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 24 May 2020 21:44:33 -0500 Subject: Image creator: Run backend `prepare()` before script This ensures that the backend preparation method can do things that affect the target environment. Necessary for ISO prep, at least. --- image/creator.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/image/creator.cc b/image/creator.cc index c83c597..8a6cc73 100644 --- a/image/creator.cc +++ b/image/creator.cc @@ -158,13 +158,6 @@ int main(int argc, char *argv[]) { } else { int ret; - my_script->setTargetDirectory(ir_dir); - - if(!my_script->execute()) { - exit_code = EXIT_FAILURE; - goto trouble; - } - #define RUN_PHASE_OR_TROUBLE(_PHASE, _FRIENDLY) \ ret = backend->_PHASE();\ if(ret != 0) {\ @@ -175,6 +168,14 @@ int main(int argc, char *argv[]) { } RUN_PHASE_OR_TROUBLE(prepare, "preparation"); + + my_script->setTargetDirectory(ir_dir); + + if(!my_script->execute()) { + exit_code = EXIT_FAILURE; + goto trouble; + } + RUN_PHASE_OR_TROUBLE(create, "creation"); RUN_PHASE_OR_TROUBLE(finalise, "finalisation"); } -- cgit v1.2.3-70-g09d2