From 68f97610695317483ef88c1ae0dcc08dfaab521a Mon Sep 17 00:00:00 2001 From: dacctal Date: Fri, 29 May 2026 11:57:34 +0000 Subject: cleaned up the update function --- src/update_all.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/update_all.c') diff --git a/src/update_all.c b/src/update_all.c index 85ad613..2d941eb 100644 --- a/src/update_all.c +++ b/src/update_all.c @@ -24,12 +24,11 @@ void update_all() { } while ((dirent_ptr = readdir(dir_ptr)) != NULL) { if (strcmp(dirent_ptr->d_name, "..") == 0 || strcmp(dirent_ptr->d_name, ".") == 0) continue; - printf("%sUpdating package: %s\n", print_pkgit, dirent_ptr->d_name); - struct stat stat_buf; - FILE* file_ptr = fopen(dirent_ptr->d_name, "r"); - if (!file_ptr) { continue; } - Pkg pkg = create_pkg(dirent_ptr->d_name, "default"); - update_pkg(pkg); + for (size_t i = 0; i < cached_repos_count; i++) { + if (!strcmp(dirent_ptr->d_name, cached_repos[i].source_key) == 0) continue; + Pkg pkg = create_pkg(cached_repos[i].source_value, "default"); + update_pkg(pkg); + } } closedir(dir_ptr); } \ No newline at end of file -- cgit v1.2.3