From f26b7ff8a83e93c073598120d0870b885672ca22 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 25 Jul 2026 15:18:41 -0400 Subject: absolute paths to allow building --- snag/src/source_db.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'snag/src/source_db.c') 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 @@ -9,8 +10,6 @@ #include #include -#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); -- cgit v1.2.3