From 1c8615089f05f22690f19257919f41db692f6e23 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 6 Dec 2024 11:00:51 +0100 Subject: [PATCH] reports: don't count as required packages which have alternative provides --- src/reports.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/reports.c b/src/reports.c index 41c2cc8..938628f 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1820,9 +1820,10 @@ int print_datatables(struct configTag *ct, int arch) { fprintf(fd," "); } } - for (int j = 0; j < currheaderlist->require[i]->resolved->numproviders; j++) { - if (currheaderlist->require[i]->resolved->provider[j]->sourceheader != currheaderlist->sourceheader) - currheaderlist->require[i]->resolved->provider[j]->sourceheader->childrenrequiredcount[arch]++; + // Update count for required packages if single provider + if (currheaderlist->require[i]->resolved->numproviders == 1) { + if (currheaderlist->require[i]->resolved->provider[0]->sourceheader != currheaderlist->sourceheader) + currheaderlist->require[i]->resolved->provider[0]->sourceheader->childrenrequiredcount[arch]++; } } } @@ -1857,9 +1858,10 @@ int print_datatables(struct configTag *ct, int arch) { fprintf(fd," "); } } - for (int j = 0; j < currheaderlist->recommend[i]->resolved->numproviders; j++) { - if (currheaderlist->recommend[i]->resolved->provider[j]->sourceheader != currheaderlist->sourceheader) - currheaderlist->recommend[i]->resolved->provider[j]->sourceheader->childrenrequiredcount[arch]++; + // Update count for recommended packages if single provider + if (currheaderlist->recommend[i]->resolved->numproviders == 1) { + if (currheaderlist->recommend[i]->resolved->provider[0]->sourceheader != currheaderlist->sourceheader) + currheaderlist->recommend[i]->resolved->provider[0]->sourceheader->childrenrequiredcount[arch]++; } } } @@ -1875,9 +1877,10 @@ int print_datatables(struct configTag *ct, int arch) { fprintf(fbd," "); fprintf_depstable_filtered_var(fbd,currheaderlist->sourceheader->require[i]->name); if (currheaderlist->sourceheader->require[i]->resolved) { - for (int j = 0; j < currheaderlist->sourceheader->require[i]->resolved->numproviders; j++) { - if (currheaderlist->sourceheader->require[i]->resolved->provider[j]->sourceheader != currheaderlist->sourceheader) - currheaderlist->sourceheader->require[i]->resolved->provider[j]->sourceheader->childrenrequiredcount[arch]++; + // Update count for required source packages if single provider + if (currheaderlist->sourceheader->require[i]->resolved->numproviders == 1) { + if (currheaderlist->sourceheader->require[i]->resolved->provider[0]->sourceheader != currheaderlist->sourceheader) + currheaderlist->sourceheader->require[i]->resolved->provider[0]->sourceheader->childrenrequiredcount[arch]++; } } }