Add warnings for missing dependencies caused by obsoleted packages

This commit is contained in:
Silvan Calarco 2012-05-29 16:32:51 +02:00
parent b80887e10c
commit 372e91d705

View File

@ -272,6 +272,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx)
logmsg(LOG_WARNING,"%s", buf);
break;
}
currheader -> obsoleted = 1;
currheader = currheader -> nextbrother;
}
} else {
@ -419,9 +420,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
// currheader->require.resolved = malloc(sizeof(struct providedList*)*currheader->requirecount);
for (i = 0; i < currheader->requirecount; i++) {
/* if (strncmp("a2ps",currheader->name,4) == 0) {
fprintf(stderr,"a2ps:%s\n",currheader->require[i]->name);
}*/
if (!strncmp("executable(",currheader->require[i]->name,11)) {
/* dynamic requirement for executable file */
/* fprintf(stderr,"Warning: skipping unhandled requirement %s for package %s\n",
@ -434,7 +433,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
// check if require[i]->name requirement is met
scanheader = ct->headerlist[archidx];
if ((currheader->require[i]->name)[0] == '/') {
if ((currheader->require[i]->name)[0] == '/') {
/* requirement is a file, find who provides it */
file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name);
if (file->numproviders > 0) {
@ -472,6 +471,20 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
addWarning(currheader->sourceheader,warning);
}
} else { /* provided->numproviders > 0 */
for (j = 0; j < provided->numproviders; j++) {
if (provided->provider[j] && provided->provider[j]->obsoleted) {
snprintf(warning, PATH_MAX, "%s needed by %s(%s,%s) is provided by obsoleted package %s(%s,%s)",
provided->name,
currheader->name,
currheader->arch,
ct->repository[currheader->altrepository]->tag,
provided->provider[j]->name,
provided->provider[j]->arch,
ct->repository[provided->provider[j]->altrepository]->tag);
fprintf(stderr,"Warning: %s\n",warning);
addWarning(currheader->sourceheader,warning);
}
}
if ((currheader->require[i]->name)[0] == '/') {
/* when there is a Requires: /file/requirement add provide from file tree as well */
file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name);
@ -497,13 +510,13 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
}
}
}
if (provided->numversions > 0) {
if (strcmp(currheader->require[i]->version,"") &&
(currheader->require[i]->flags & (RPMSENSE_LESS|RPMSENSE_GREATER|RPMSENSE_EQUAL))) {
found = 0;
for (j = 0; j < provided->numversions; j++) {
if (!strcmp(provided->version[j],"")) {
/* provider with no version; assume ok */
found = 1;