Add rebuildList to source headers to output pkg_needrebuild() in build-*.sh files

This commit is contained in:
Silvan Calarco 2014-07-06 00:49:04 +02:00
parent 9e403c278f
commit e2d17e725a
4 changed files with 46 additions and 2 deletions

View File

@ -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,

View File

@ -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)
{

View File

@ -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 */

View File

@ -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;
}