diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-12-06 08:43:27 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-12-06 08:43:40 -0500 |
commit | 0c18b5b15ed6e78cc27580518ae29f20ff23da65 (patch) | |
tree | 7a468237049f1db65d9c6ffed5f0c89dc7e4d271 /src/cli/stasis_indexer/readmes.c | |
parent | 47b0eb0ffc358393238a2e4ec8600f5a862a99b5 (diff) | |
download | stasis-0c18b5b15ed6e78cc27580518ae29f20ff23da65.tar.gz |
Fix pointers to Delivery struct
* Dynamic allocation only. I'm completely fed up with "lost" addresses.
Diffstat (limited to 'src/cli/stasis_indexer/readmes.c')
-rw-r--r-- | src/cli/stasis_indexer/readmes.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cli/stasis_indexer/readmes.c b/src/cli/stasis_indexer/readmes.c index 75e97a9..c98ecfc 100644 --- a/src/cli/stasis_indexer/readmes.c +++ b/src/cli/stasis_indexer/readmes.c @@ -2,7 +2,7 @@ #include "readmes.h" int indexer_readmes(struct Delivery ctx[], const size_t nelem) { - struct Delivery **latest = NULL; + struct Delivery *latest = NULL; latest = get_latest_deliveries(ctx, nelem); char indexfile[PATH_MAX] = {0}; @@ -14,8 +14,8 @@ int indexer_readmes(struct Delivery ctx[], const size_t nelem) { fprintf(stderr, "Unable to open %s for writing\n", indexfile); return -1; } - struct StrList *archs = get_architectures(*latest, nelem); - struct StrList *platforms = get_platforms(*latest, nelem); + struct StrList *archs = get_architectures(latest, nelem); + struct StrList *platforms = get_platforms(latest, nelem); fprintf(indexfp, "# %s-%s\n\n", ctx->meta.name, ctx->meta.version); fprintf(indexfp, "## Current Release\n\n"); @@ -25,9 +25,9 @@ int indexer_readmes(struct Delivery ctx[], const size_t nelem) { char *arch = strlist_item(archs, a); int have_combo = 0; for (size_t i = 0; i < nelem; i++) { - if (latest[i] && latest[i]->system.platform) { - if (strstr(latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], platform) && - strstr(latest[i]->system.arch, arch)) { + if (latest[i].system.platform) { + if (strstr(latest[i].system.platform[DELIVERY_PLATFORM_RELEASE], platform) && + strstr(latest[i].system.arch, arch)) { have_combo = 1; } } @@ -44,13 +44,13 @@ int indexer_readmes(struct Delivery ctx[], const size_t nelem) { char readme_name[PATH_MAX]; char conf_name[PATH_MAX]; char conf_name_relative[PATH_MAX]; - if (!latest[i]) { + if (!latest[i].meta.name) { continue; } - sprintf(link_name, "latest-py%s-%s-%s.yml", latest[i]->meta.python_compact, latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], latest[i]->system.arch); - sprintf(readme_name, "README-py%s-%s-%s.md", latest[i]->meta.python_compact, latest[i]->system.platform[DELIVERY_PLATFORM_RELEASE], latest[i]->system.arch); - sprintf(conf_name, "%s.ini", latest[i]->info.release_name); - sprintf(conf_name_relative, "../config/%s-rendered.ini", latest[i]->info.release_name); + sprintf(link_name, "latest-py%s-%s-%s.yml", latest[i].meta.python_compact, latest[i].system.platform[DELIVERY_PLATFORM_RELEASE], latest[i].system.arch); + sprintf(readme_name, "README-py%s-%s-%s.md", latest[i].meta.python_compact, latest[i].system.platform[DELIVERY_PLATFORM_RELEASE], latest[i].system.arch); + sprintf(conf_name, "%s.ini", latest[i].info.release_name); + sprintf(conf_name_relative, "../config/%s.ini", latest[i].info.release_name); if (strstr(link_name, platform) && strstr(link_name, arch)) { fprintf(indexfp, "|[%s](%s)|[%s](%s)|[%s](%s)|\n", link_name, link_name, readme_name, readme_name, conf_name, conf_name_relative); } |