From 88887423f4aca28540e1fba8316401daed8ac468 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 8 Nov 2020 10:53:37 +0100 Subject: [PATCH] Skip "debuginfo(build-id)" multiple provided element from obsolete checking --- src/distromatic.c | 13 +++++++------ src/include/distromatic.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index a785baf..e9d41a3 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -249,12 +249,13 @@ handleObsoletedPackages(struct configTag *ct, int archidx) struct headerList *currheader; while (prov) { - - if (prov->numproviders > OBSOLETE_MAX) { - return 1; - } - - if (prov->numproviders > 1) { + // Skip debuginfo(build-id) provides which would need very big multiple providers buffer size + if (prov->numproviders > 1 && (strncmp(prov->name, "debuginfo(build-id)", 20) < 0)) { + if (prov->numproviders > OBSOLETE_MAX) { + fprintf(stderr, "Error: %s has too many providers (%d > %d)\n", + prov->name, prov->numproviders, OBSOLETE_MAX); + return 1; + } for (i = 0; i < prov->numproviders; i++) obs[i]=-1; for (i = 0; i < prov->numproviders; i++) for (j = 0; j < prov->provider[i]->obsoletecount; j++) diff --git a/src/include/distromatic.h b/src/include/distromatic.h index 8e1cf92..e1e6876 100644 --- a/src/include/distromatic.h +++ b/src/include/distromatic.h @@ -11,7 +11,7 @@ #define PACKAGE_BUGREPORT "silvan.calarco@mambasoft.it" #define ARCHS_MAX 5 -#define OBSOLETE_MAX 16384 +#define OBSOLETE_MAX 1024 #define DEFAULT_ARCH "i586" #define CONF_DEFAULTS_SECTION 1 #define CONF_REP_SECTION 0