diff --git a/src/distromatic.c b/src/distromatic.c index d78ed5b..39509d1 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -511,6 +511,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) !currheader->obsoleted) k++; } if (k == provided->numproviders) { // all provides are from older packages + addRebuild(provided->provider[j]->sourceheader,currheader->sourceheader); snprintf(warning, PATH_MAX, "%s(%s,%s) requires %s which is only provided by older package(s):", currheader->name, currheader->arch, diff --git a/src/headerlist.c b/src/headerlist.c index 99fe191..63b02d9 100644 --- a/src/headerlist.c +++ b/src/headerlist.c @@ -93,6 +93,32 @@ struct warningList* addWarning(struct headerSourceList *pkg, char* text) return pkg->firstwarning; } +struct rebuildList* addRebuild(struct headerSourceList *pkg, struct headerSourceList* sourceheader) +{ + struct rebuildList *currrebuild, *prevrebuild = NULL; + + if (!pkg) return NULL; + + currrebuild = pkg->firstrebuild; + + while (currrebuild) { + if (currrebuild->sourceheader == sourceheader) return currrebuild; + prevrebuild = currrebuild; + currrebuild = currrebuild->next; + } + + currrebuild=malloc(sizeof(currrebuild)); + if (!currrebuild) return NULL; + if (!pkg->firstrebuild) pkg->firstrebuild=currrebuild; + + currrebuild->sourceheader=sourceheader; + if (!currrebuild->sourceheader) return NULL; + + currrebuild->next=NULL; + if (prevrebuild) prevrebuild->next=currrebuild; + return pkg->firstrebuild; +} + struct headerList * findPackageByName(struct headerList *list, char *name) { diff --git a/src/include/headerlist.h b/src/include/headerlist.h index d50a71a..51c9c42 100644 --- a/src/include/headerlist.h +++ b/src/include/headerlist.h @@ -61,6 +61,11 @@ struct warningList { struct warningList *next; }; +struct rebuildList { + struct headerSourceList *sourceheader; + struct rebuildList *next; +}; + struct Require { char *name; long flags; @@ -139,6 +144,7 @@ struct headerSourceList { struct headerList *firstchild[ARCHS_MAX]; struct warningList *firstwarning; struct headerSourceList *updatingparent; + struct rebuildList *firstrebuild; long id; }; @@ -219,6 +225,8 @@ addToHeaderList(struct configTag *ct, struct warningList* addWarning(struct headerSourceList *pkg,char* text); +struct rebuildList* addRebuild(struct headerSourceList *pkg, struct headerSourceList* sourceheader); + int getPackageNameFromFile(char *name); #endif /* HEADERLIST_H */ diff --git a/src/reports.c b/src/reports.c index 051b626..af7584f 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1774,6 +1774,7 @@ print_datatables(struct configTag *ct, int arch) { char obsoletebuf[PATH_MAX]; struct headerList *currheaderlist, *currchild; struct headerSourceList * currheadersourcelist; + struct rebuildList * currrebuild; int i, nonobsoletednumproviders; snprintf(builddeps_filename,1024,"%sbuilddeps-%s",ct->html_dir,ct->arch[arch]); @@ -2085,8 +2086,16 @@ print_datatables(struct configTag *ct, int arch) { currchild = currchild->nextbrother; if (currchild) fprintf(fbsh," "); } - fprintf(fbsh,"); pkg_obsoletes=(%s); }\n",obsoletebuf); - fprintf(fb,"\n"); + fprintf(fbsh,"); pkg_obsoletes=(%s);",obsoletebuf); + + fprintf(fbsh,"pkg_needrebuild=("); + currrebuild=currheadersourcelist->firstrebuild; + while (currrebuild) { + fprintf(fbsh, "%s ", currrebuild->sourceheader->name); + currrebuild = currrebuild->next; + } + fprintf(fb,"); }\n\n"); + } currheadersourcelist = currheadersourcelist->next; }