diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-07-25 15:18:41 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-07-25 15:18:41 -0400 |
| commit | f26b7ff8a83e93c073598120d0870b885672ca22 (patch) | |
| tree | 020edd3ed390f9f4535be0d03f5e0b290adc0137 /snag/src/source_db.c | |
| parent | 6b27d8c6ad1f0cbbb36775a0b8c4d462ac7f9929 (diff) | |
absolute paths to allow building
Diffstat (limited to 'snag/src/source_db.c')
| -rw-r--r-- | snag/src/source_db.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/snag/src/source_db.c b/snag/src/source_db.c index d49e0c4..75f2e61 100644 --- a/snag/src/source_db.c +++ b/snag/src/source_db.c @@ -1,5 +1,6 @@ #include "source_db.h" +#include "cfg.h" #include "util.h" #include <curl/curl.h> @@ -9,8 +10,6 @@ #include <unistd.h> #include <errno.h> -#define EXTRACT_TAR_SCRIPT "./scripts/extract_tar_contents.sh" - // libcrpyto context EVP_MD_CTX *mdctx = NULL; const EVP_MD *md = NULL; @@ -20,9 +19,7 @@ void ensure_libcrypto(); CURL *curl = NULL; void ensure_libcurl(); -// note: fixed location of source database for now -const char source_db_path[] = "./var/snag/sources"; -char* get_source_path(const source_info_t* source) { return join_path(source_db_path, source->name); } +char* get_source_path(const source_info_t* source) { return join_path(cfg.source_db, source->name); } bool verify_source(source_info_t* source) { // verify source exists @@ -106,7 +103,7 @@ static size_t download_write_callback(char* ptr, size_t size, size_t nmemb, void bool unpack_source(const source_info_t* source, char* dest_path) { char* source_path = get_source_path(source); - char* command = vastrcat(EXTRACT_TAR_SCRIPT, " ", source_path, " ", dest_path); + char* command = vastrcat(cfg.untar_script, " ", source_path, " ", dest_path); // just run the unpack script. we can rewrite in c in the future int ret = system(command); |
