Commit e2d17e725a84b143ea8a6d7072b1803d85333447

Authored by Silvan Calarco
1 parent 9e403c278f
Exists in master

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

Showing 4 changed files with 46 additions and 2 deletions Side-by-side Diff

... ... @@ -511,6 +511,7 @@
511 511 !currheader->obsoleted) k++;
512 512 }
513 513 if (k == provided->numproviders) { // all provides are from older packages
  514 + addRebuild(provided->provider[j]->sourceheader,currheader->sourceheader);
514 515 snprintf(warning, PATH_MAX, "%s(%s,%s) requires %s which is only provided by older package(s):",
515 516 currheader->name,
516 517 currheader->arch,
... ... @@ -93,6 +93,32 @@
93 93 return pkg->firstwarning;
94 94 }
95 95  
  96 +struct rebuildList* addRebuild(struct headerSourceList *pkg, struct headerSourceList* sourceheader)
  97 +{
  98 + struct rebuildList *currrebuild, *prevrebuild = NULL;
  99 +
  100 + if (!pkg) return NULL;
  101 +
  102 + currrebuild = pkg->firstrebuild;
  103 +
  104 + while (currrebuild) {
  105 + if (currrebuild->sourceheader == sourceheader) return currrebuild;
  106 + prevrebuild = currrebuild;
  107 + currrebuild = currrebuild->next;
  108 + }
  109 +
  110 + currrebuild=malloc(sizeof(currrebuild));
  111 + if (!currrebuild) return NULL;
  112 + if (!pkg->firstrebuild) pkg->firstrebuild=currrebuild;
  113 +
  114 + currrebuild->sourceheader=sourceheader;
  115 + if (!currrebuild->sourceheader) return NULL;
  116 +
  117 + currrebuild->next=NULL;
  118 + if (prevrebuild) prevrebuild->next=currrebuild;
  119 + return pkg->firstrebuild;
  120 +}
  121 +
96 122 struct headerList *
97 123 findPackageByName(struct headerList *list, char *name)
98 124 {
src/include/headerlist.h
... ... @@ -61,6 +61,11 @@
61 61 struct warningList *next;
62 62 };
63 63  
  64 +struct rebuildList {
  65 + struct headerSourceList *sourceheader;
  66 + struct rebuildList *next;
  67 +};
  68 +
64 69 struct Require {
65 70 char *name;
66 71 long flags;
... ... @@ -139,6 +144,7 @@
139 144 struct headerList *firstchild[ARCHS_MAX];
140 145 struct warningList *firstwarning;
141 146 struct headerSourceList *updatingparent;
  147 + struct rebuildList *firstrebuild;
142 148 long id;
143 149 };
144 150  
... ... @@ -218,6 +224,8 @@
218 224 int arch);
219 225  
220 226 struct warningList* addWarning(struct headerSourceList *pkg,char* text);
  227 +
  228 +struct rebuildList* addRebuild(struct headerSourceList *pkg, struct headerSourceList* sourceheader);
221 229  
222 230 int getPackageNameFromFile(char *name);
223 231  
... ... @@ -1774,6 +1774,7 @@
1774 1774 char obsoletebuf[PATH_MAX];
1775 1775 struct headerList *currheaderlist, *currchild;
1776 1776 struct headerSourceList * currheadersourcelist;
  1777 + struct rebuildList * currrebuild;
1777 1778 int i, nonobsoletednumproviders;
1778 1779  
1779 1780 snprintf(builddeps_filename,1024,"%sbuilddeps-%s",ct->html_dir,ct->arch[arch]);
... ... @@ -2085,8 +2086,16 @@
2085 2086 currchild = currchild->nextbrother;
2086 2087 if (currchild) fprintf(fbsh," ");
2087 2088 }
2088   - fprintf(fbsh,"); pkg_obsoletes=(%s); }\n",obsoletebuf);
2089   - fprintf(fb,"\n");
  2089 + fprintf(fbsh,"); pkg_obsoletes=(%s);",obsoletebuf);
  2090 +
  2091 + fprintf(fbsh,"pkg_needrebuild=(");
  2092 + currrebuild=currheadersourcelist->firstrebuild;
  2093 + while (currrebuild) {
  2094 + fprintf(fbsh, "%s ", currrebuild->sourceheader->name);
  2095 + currrebuild = currrebuild->next;
  2096 + }
  2097 + fprintf(fb,"); }\n\n");
  2098 +
2090 2099 }
2091 2100 currheadersourcelist = currheadersourcelist->next;
2092 2101 }