STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
recipe.h File Reference
#include "str.h"
#include "utils.h"
Include dependency graph for recipe.h:

Go to the source code of this file.

Macros

#define RECIPE_TYPE_UNKNOWN   0
 Unable to determine recipe repo type.
 
#define RECIPE_TYPE_CONDA_FORGE   1
 Recipe repo is from conda-forge.
 
#define RECIPE_TYPE_ASTROCONDA   2
 Recipe repo is from astroconda.
 
#define RECIPE_TYPE_GENERIC   3
 Recipe repo provides the required build configurations but doesn't match conda-forge or astroconda's signature.
 

Functions

int recipe_clone (char *recipe_dir, char *url, char *gitref, char **result)
 
int recipe_get_type (char *repopath)
 

Function Documentation

◆ recipe_clone()

int recipe_clone ( char * recipe_dir,
char * url,
char * gitref,
char ** result )

Download a Conda package recipe

char *recipe = NULL;
if (recipe_clone("base/dir", "https://github.com/example/repo", "branch", &recipe)) {
fprintf(stderr, "Failed to clone conda recipe\n");
exit(1);
} else {
chdir(recipe);
}
int recipe_clone(char *recipe_dir, char *url, char *gitref, char **result)
Definition recipe.c:3
Parameters
recipe_dirpath to store repository
urlremote address of git repository
gitrefbranch/tag/commit
resultabsolute path to downloaded repository
Returns
exit code from "git", -1 on error
Here is the call graph for this function:

◆ recipe_get_type()

int recipe_get_type ( char * repopath)

Determine the layout/type of repository path

if (recipe_clone("base/dir", "https://github.com/example/repo", "branch", &recipe)) {
fprintf(stderr, "Failed to clone conda recipe\n");
exit(1);
}
int recipe_type;
recipe_type = recipe_get_type(recipe);
switch (recipe_type) {
// do something specific for conda-forge directory structure
break;
// do something specific for astroconda directory structure
break;
// do something specific for a directory containing a meta.yaml config
break;
default:
// the structure is foreign or the path doesn't contain a conda recipe
break;
}
#define RECIPE_TYPE_GENERIC
Recipe repo provides the required build configurations but doesn't match conda-forge or astroconda's ...
Definition recipe.h:15
#define RECIPE_TYPE_UNKNOWN
Unable to determine recipe repo type.
Definition recipe.h:9
#define RECIPE_TYPE_CONDA_FORGE
Recipe repo is from conda-forge.
Definition recipe.h:11
#define RECIPE_TYPE_ASTROCONDA
Recipe repo is from astroconda.
Definition recipe.h:13
int recipe_get_type(char *repopath)
Definition recipe.c:38
Parameters
repopathpath to git repository containing conda recipe(s)
Returns
One of RECIPE_TYPE_UNKNOWN, RECIPE_TYPE_CONDA_FORGE, RECIPE_TYPE_ASTROCONDA, RECIPE_TYPE_GENERIC