headerlist: generateHeaderList (repodata): process upstream packages first to fix following provder checks for updated packages

This commit is contained in:
Silvan Calarco 2021-03-12 21:25:41 +01:00
parent 4891e1f7ec
commit 56677044b8
2 changed files with 48 additions and 50 deletions

View File

@ -457,9 +457,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
continue; continue;
} }
// currheader->require.resolved = malloc(sizeof(struct providedList*)*currheader->requirecount); // currheader->require.resolved = malloc(sizeof(struct providedList*)*currheader->requirecount);
for (i = 0; i < currheader->requirecount; i++) { for (i = 0; i < currheader->requirecount; i++) {
if (!strncmp("executable(",currheader->require[i]->name,11)) { if (!strncmp("executable(",currheader->require[i]->name,11)) {
/* dynamic requirement for executable file */ /* dynamic requirement for executable file */
/* fprintf(stderr,"Warning: skipping unhandled requirement %s for package %s\n", /* fprintf(stderr,"Warning: skipping unhandled requirement %s for package %s\n",
@ -594,20 +592,10 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
if (provided->numproviders > 0) { if (provided->numproviders > 0) {
if (strcmp(currheader->require[i]->version,"") && if (strcmp(currheader->require[i]->version,"") &&
(currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) { (currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) {
found = 0; found = 0;
foundprovider = -1; foundprovider = -1;
foundupstreamprovider = 0; foundupstreamprovider = 0;
for (j = 0; j < provided->numproviders; j++) { for (j = 0; j < provided->numproviders; j++) {
/* updated packages: ignore check with upstream package */
if ((foundprovider >= 0) &&
!strcmp(provided->provider[foundprovider]->name,provided->provider[j]->name) &&
provided->provider[foundprovider]->altrepository < provided->provider[j]->altrepository)
{
found -= 1;
foundupstreamprovider = foundprovider;
foundprovider = -1;
}
if (!strcmp(provided->version[j],"")) { if (!strcmp(provided->version[j],"")) {
/* provider with no version; assume ok */ /* provider with no version; assume ok */
found += 1; found += 1;
@ -623,6 +611,15 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
foundprovider = j; foundprovider = j;
} }
} }
/* updated packages: ignore check with upstream package */
if ((foundprovider >= 0) &&
!strcmp(provided->provider[foundprovider]->name,provided->provider[j]->name) &&
provided->provider[foundprovider]->altrepository < provided->provider[j]->altrepository)
{
found -= 1;
foundupstreamprovider = foundprovider;
foundprovider = -1;
}
} /* for */ } /* for */
if ((found >= 1) && (!foundupstreamprovider) && if ((found >= 1) && (!foundupstreamprovider) &&
(currheader->altrepository != 0) && (currheader->altrepository != 0) &&

View File

@ -1554,6 +1554,7 @@ char* advanceXMLPackageNode(xmlNode **primary_node, xmlNode **filelists_node) {
(nextname[0] == '\0' || strcmp(nextname, currnames[i]) >= 0)) { (nextname[0] == '\0' || strcmp(nextname, currnames[i]) >= 0)) {
strncpy(nextname, currnames[i], bufsize); strncpy(nextname, currnames[i], bufsize);
altidx = i; altidx = i;
break;
} }
} }