Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync operation doesn't remove pattern when source is empty #5

Open
cottsay opened this issue Apr 3, 2024 · 0 comments
Open

Sync operation doesn't remove pattern when source is empty #5

cottsay opened this issue Apr 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@cottsay
Copy link
Member

cottsay commented Apr 3, 2024

When performing a --sync operation from another repository, there's a "shortcut" in the logic which returns early if there were no packages found in the source repository matching the sync pattern. While this makes some sense, the result is that the pattern-based invalidation which would have removed all packages from the downstream repository matching the pattern doesn't occur.

if (pattern) {
g_hash_table_iter_init(&iter, packages);
while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&package)) {
if (!g_regex_match(pattern, package->name, 0, NULL)) {
g_hash_table_iter_remove(&iter);
}
}
}
if (!g_hash_table_size(packages)) {
g_string_free(url, TRUE);
cr_metadata_free(md);
return CRE_OK;
}

@cottsay cottsay added the bug Something isn't working label Apr 3, 2024
@cottsay cottsay self-assigned this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant