From 6649d2bd7b512f96a42ed9035291f97b4a5ef3c5 Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Mon, 7 Sep 2026 12:59:05 +0200 Subject: fix: skip temporary directory creation error if it already exists --- src/download.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/download.c') diff --git a/src/download.c b/src/download.c index 351a36b..a833932 100644 --- a/src/download.c +++ b/src/download.c @@ -15,9 +15,6 @@ int pow_download_file(char *path, char *url) { FILE *pagefile; CURL *curl = curl_easy_init(); - printf("%s", path); - printf("%s", url); - if (!curl) { printf("failed to init curl\n"); @@ -27,6 +24,7 @@ int pow_download_file(char *path, char *url) { curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "pow! (codeberg.org/einfach/pow)"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); @@ -57,7 +55,13 @@ int pow_download_source(pow_package_source *src, const char *prefix) { snprintf(full_path, len, "%s/%s", prefix, src->out); - pow_download_file(full_path, src->in); + printf("downloading source file: %s", src->in); + + if (pow_download_file(full_path, src->in)) { + printf("failed to download sources, aborting\n"); + + return 1; + } return 0; } -- cgit v1.3