From 1608353b3a1032b7e177d4558b5908febdfccc84 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 22 Feb 2025 20:00:41 +0000 Subject: [PATCH] repo: Fix writing configuration Signed-off-by: Michael Tremer --- src/pakfire/repo.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pakfire/repo.c b/src/pakfire/repo.c index 3046596f..f087f4e9 100644 --- a/src/pakfire/repo.c +++ b/src/pakfire/repo.c @@ -1776,15 +1776,17 @@ int pakfire_repo_write_config(struct pakfire_repo* repo, FILE* f) { } // Refresh Interval - r = pakfire_string_format_interval(refresh, repo->appdata->refresh); - if (r < 0) - goto ERROR; + if (repo->appdata->refresh >= 0) { + r = pakfire_string_format_interval(refresh, repo->appdata->refresh); + if (r < 0) + goto ERROR; - // Set the refresh interval - r = pakfire_config_set(config, section, "refresh", refresh); - if (r < 0) { - ERROR(repo->ctx, "Could not set refresh interval: %s\n", strerror(-r)); - goto ERROR; + // Set the refresh interval + r = pakfire_config_set(config, section, "refresh", refresh); + if (r < 0) { + ERROR(repo->ctx, "Could not set refresh interval: %s\n", strerror(-r)); + goto ERROR; + } } // Mirror List -- 2.39.5