diff options
| -rw-r--r-- | src/cli/stasis_indexer/helpers.c | 17 | ||||
| -rw-r--r-- | src/cli/stasis_indexer/helpers.h | 1 | 
2 files changed, 18 insertions, 0 deletions
| diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c index f67292f..6d2fdd0 100644 --- a/src/cli/stasis_indexer/helpers.c +++ b/src/cli/stasis_indexer/helpers.c @@ -255,6 +255,23 @@ int get_files(struct StrList **out, const char *path, const char *pattern, ...)      return 0;  } +struct StrList *get_docker_images(struct Delivery *ctx, char *pattern) { +    char *tarball = NULL; +    asprintf(&tarball, "%s*.tar*", pattern); +    if (!tarball) { +        SYSERROR("%s", "Unable to allocate bytes for docker image wildcard pattern"); +        return NULL; +    } +    tolower_s(tarball); +    replace_text(tarball, "+", "-", 0); + +    struct StrList *files = NULL; +    get_files(&files, ctx->storage.docker_artifact_dir, tarball); +    guard_free(tarball); + +    return files; +} +  int load_metadata(struct Delivery *ctx, const char *filename) {      char line[STASIS_NAME_MAX] = {0}; diff --git a/src/cli/stasis_indexer/helpers.h b/src/cli/stasis_indexer/helpers.h index 733691d..d493f75 100644 --- a/src/cli/stasis_indexer/helpers.h +++ b/src/cli/stasis_indexer/helpers.h @@ -20,6 +20,7 @@ int pandoc_exec(const char *in_file, const char *out_file, const char *css_file,  int get_latest_rc(struct Delivery ctx[], size_t nelem);  struct Delivery *get_latest_deliveries(struct Delivery ctx[], size_t nelem);  int get_files(struct StrList **out, const char *path, const char *pattern, ...); +struct StrList *get_docker_images(struct Delivery *ctx, char *pattern);  int load_metadata(struct Delivery *ctx, const char *filename);  int micromamba_configure(const struct Delivery *ctx, struct MicromambaInfo *m); | 
