Check for binary packages with same name in upper level repositories when coming from sources with different names

This commit is contained in:
Silvan Calarco 2012-03-16 15:18:43 +01:00
parent dc9d1ec36e
commit 5ef0704967
2 changed files with 38 additions and 1 deletions

View File

@ -375,6 +375,43 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx)
scanheader = ct->headerlist[archidx];
currrequire = NULL;
currheader->requirelist = NULL;
if ((!currheader->obsoleted) && (currheader->next) && (!strcmp(currheader->name,currheader->next->name))) {
// mark obsoleted any package with same name in upper level repositories
if (currheader->altrepository < currheader->next->altrepository) {
currheader->obsoleted = 1;
if (checkVersionWithFlags(
currheader->version,
RPMSENSE_GREATER & RPMSENSE_EQUAL,
currheader->next->version)) {
snprintf(warning,PATH_MAX,"%s(%s,%s): same or higher version than package with same name in %s (%s >= %s)",
currheader->name,
ct->arch[archidx],
ct->repository[currheader->altrepository]->tag,
ct->repository[currheader->next->altrepository]->tag,
currheader->version,
currheader->next->version);
fprintf(stderr,"Warning: %s\n",warning);
addWarning(currheader->sourceheader,warning);
}
} else if (currheader->altrepository >= currheader->next->altrepository) {
currheader->next->obsoleted = 1;
if (checkVersionWithFlags(
currheader->version,
RPMSENSE_LESS & RPMSENSE_EQUAL,
currheader->next->version)) {
snprintf(warning,PATH_MAX,"%s(%s,%s): same or higher version than package with same name in %s (%s >= %s)",
currheader->next->name,
ct->arch[archidx],
ct->repository[currheader->next->altrepository]->tag,
ct->repository[currheader->altrepository]->tag,
currheader->next->version,
currheader->version);
fprintf(stderr,"Warning: %s\n",warning);
addWarning(currheader->sourceheader,warning);
}
}
}
if (currheader->obsoleted) {
currheader = currheader->next;
continue;

View File

@ -824,7 +824,7 @@ addToHeaderList(struct configTag *ct,
currname[0] = '\0';
}
for (i = 0; i < ALT_REPS_MAX; i++) {
/* scan alternate repositories to find any packge which comes first according to name sorting */
/* scan alternate repositories to find any package which comes first according to name sorting */
if (altscanpath[i] && (altcnt[i] < altn[i]) &&
((rpmnamecmp(currname, altnamelist[i][altcnt[i]]->d_name,0) >= 0) || (currname[0] == '\0'))) {
strncpy(currname, altnamelist[i][altcnt[i]]->d_name,bufsize);