#include #include #include "libmbpk.h" #include #include #include #define MBPK_DB_DIR "/var/lib/mbpk" #define MBPK_REPO_DIR "/var/lib/mbpk-repo" #define MBPK_REPO_CONFIG "/etc/mbpk-repos.ini" typedef struct { const char* name; const char* desc; const char* url; } mbpk_repository; mbpk_repository **repos; int mbpk_init(void) { struct stat st; if (stat(MBPK_DB_DIR, &st) == -1) { if (mkdir(MBPK_DB_DIR, 0755) == -1) { fprintf(stderr, "mbpk [err]: failed to create %s: %s\n", MBPK_DB_DIR, strerror(errno)); return MBPK_DB_FAIL; } } if (stat(MBPK_REPO_DIR, &st) == -1) { fprintf(stderr, "mbpk [warn]: no repositories found! you might want to sync all repositories using mbpk-update.\n"); } return MBPK_OK; }