diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:08:56 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-04-02 18:55:47 -0400 |
commit | 26b45ecfae8c15f242a9b29abec5a49b9045f97e (patch) | |
tree | 7cb033fb14a3f062e1dd8454b48f7b536aacb7fa | |
parent | 28c7c9095af3256f9e6c59b6138f4c28b216a806 (diff) | |
download | stasis-26b45ecfae8c15f242a9b29abec5a49b9045f97e.tar.gz |
Move system.{arch,platform} template registrations into delivery_init_platform()
-rw-r--r-- | src/deliverable.c | 6 | ||||
-rw-r--r-- | src/main.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/deliverable.c b/src/deliverable.c index bd2634d..cb3487a 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -324,6 +324,12 @@ int delivery_init_platform(struct Delivery *ctx) { setenv("OMC_CONDA_PLATFORM", ctx->system.platform[DELIVERY_PLATFORM_CONDA_INSTALLER], 1); setenv("OMC_CONDA_PLATFORM_SUBDIR", ctx->system.platform[DELIVERY_PLATFORM_CONDA_SUBDIR], 1); + // Register template variables + // These were moved out of main() because we can't take the address of system.platform[x] + // _before_ the array has been initialized. + tpl_register("system.arch", &ctx->system.arch); + tpl_register("system.platform", &ctx->system.platform[DELIVERY_PLATFORM_RELEASE]); + return 0; } @@ -252,8 +252,6 @@ int main(int argc, char *argv[]) { tpl_register("conda.installer_version", &ctx.conda.installer_version); tpl_register("conda.installer_arch", &ctx.conda.installer_arch); tpl_register("conda.installer_platform", &ctx.conda.installer_platform); - tpl_register("system.arch", &ctx.system.arch); - tpl_register("system.platform", &ctx.system.platform[DELIVERY_PLATFORM_RELEASE]); tpl_register("deploy.jfrog.repo", &globals.jfrog.repo); tpl_register("deploy.docker.registry", &ctx.deploy.docker.registry); tpl_register("workaround.tox_posargs", &globals.workaround.tox_posargs); |