Commit 56baf37545020cb7f818fcc32dadd54b1c4faf03

Authored by Silvan Calarco
1 parent e2d17e725a
Exists in master

Fixes for pkg_needrebuild() and also add rebuilds as warning

Showing 3 changed files with 43 additions and 10 deletions Side-by-side Diff

... ... @@ -511,7 +511,6 @@
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);
515 514 snprintf(warning, PATH_MAX, "%s(%s,%s) requires %s which is only provided by older package(s):",
516 515 currheader->name,
517 516 currheader->arch,
... ... @@ -525,6 +524,7 @@
525 524 }
526 525 fprintf(stderr,"Warning: %s\n",warning);
527 526 for (j = 0; j < provided->numproviders; j++) {
  527 + addRebuild(provided->provider[j]->sourceheader,currheader->sourceheader);
528 528 addWarning(provided->provider[j]->sourceheader,warning);
529 529 }
530 530 } else {
... ... @@ -934,7 +934,8 @@
934 934 *configfile = NULL, *passed_arch = NULL;
935 935  
936 936 struct headerList *currheaderlist;
937   - struct headerSourceList *currheadersourcelist = NULL;
  937 + struct headerSourceList *currheadersourcelist = NULL, *oldheadersourcelist;
  938 + struct rebuildList *currrebuild;
938 939  
939 940 int i = 0,hasbuilds[ARCHS_MAX],ptharg[ARCHS_MAX];
940 941 pthread_t pth[ARCHS_MAX];
... ... @@ -1197,6 +1198,31 @@
1197 1198 strncat(warning,configtag->arch[i],PATH_MAX);
1198 1199 }
1199 1200 }
  1201 + if (warning[0] != '\0') {
  1202 + logmsg(LOG_WARNING, "%s: %s",
  1203 + currheadersourcelist->name,
  1204 + warning);
  1205 + addWarning(currheadersourcelist, warning);
  1206 + }
  1207 +
  1208 + warning[0] = '\0';
  1209 +
  1210 + currrebuild = currheadersourcelist->firstrebuild;
  1211 + oldheadersourcelist = currheadersourcelist->old;
  1212 + while (!currrebuild && oldheadersourcelist) {
  1213 + currrebuild = oldheadersourcelist->firstrebuild;
  1214 + oldheadersourcelist = oldheadersourcelist->old;
  1215 + }
  1216 +
  1217 + if (currrebuild) {
  1218 + strncat(warning,"need to be rebuilt:", PATH_MAX);
  1219 + while (currrebuild) {
  1220 + strncat(warning," ",PATH_MAX);
  1221 + strncat(warning,currrebuild->sourceheader->name,PATH_MAX);
  1222 + currrebuild = currrebuild->next;
  1223 + }
  1224 + }
  1225 +
1200 1226 if (warning[0] != '\0') {
1201 1227 logmsg(LOG_WARNING, "%s: %s",
1202 1228 currheadersourcelist->name,
... ... @@ -107,14 +107,13 @@
107 107 currrebuild = currrebuild->next;
108 108 }
109 109  
110   - currrebuild=malloc(sizeof(currrebuild));
  110 + currrebuild=malloc(sizeof(struct rebuildList));
111 111 if (!currrebuild) return NULL;
112 112 if (!pkg->firstrebuild) pkg->firstrebuild=currrebuild;
113 113  
114 114 currrebuild->sourceheader=sourceheader;
115   - if (!currrebuild->sourceheader) return NULL;
116   -
117 115 currrebuild->next=NULL;
  116 +
118 117 if (prevrebuild) prevrebuild->next=currrebuild;
119 118 return pkg->firstrebuild;
120 119 }
... ... @@ -689,6 +688,7 @@
689 688 newheadersourcelist->updatingparent = NULL;
690 689 newheadersourcelist->altrepository = altrepository;
691 690 newheadersourcelist->firstwarning = NULL;
  691 + newheadersourcelist->firstrebuild = NULL;
692 692 newheadersourcelist->old = NULL;
693 693 newheadersourcelist->id = ++sourceid;
694 694 getPackageInfoIntoHeaderSourceList(h, newheadersourcelist);
... ... @@ -1773,8 +1773,8 @@
1773 1773 contents_filename[1024], warnings_filename[1024], buf[1024];
1774 1774 char obsoletebuf[PATH_MAX];
1775 1775 struct headerList *currheaderlist, *currchild;
1776   - struct headerSourceList * currheadersourcelist;
1777   - struct rebuildList * currrebuild;
  1776 + struct headerSourceList *currheadersourcelist, *oldheadersourcelist;
  1777 + struct rebuildList *currrebuild;
1778 1778 int i, nonobsoletednumproviders;
1779 1779  
1780 1780 snprintf(builddeps_filename,1024,"%sbuilddeps-%s",ct->html_dir,ct->arch[arch]);
1781 1781  
... ... @@ -2088,13 +2088,20 @@
2088 2088 }
2089 2089 fprintf(fbsh,"); pkg_obsoletes=(%s);",obsoletebuf);
2090 2090  
2091   - fprintf(fbsh,"pkg_needrebuild=(");
2092   - currrebuild=currheadersourcelist->firstrebuild;
  2091 + /* find pointer to firstrebuild also looking into old packages */
  2092 + currrebuild = currheadersourcelist->firstrebuild;
  2093 + oldheadersourcelist = currheadersourcelist->old;
  2094 + while (!currrebuild && oldheadersourcelist) {
  2095 + currrebuild = oldheadersourcelist->firstrebuild;
  2096 + oldheadersourcelist = oldheadersourcelist->old;
  2097 + }
  2098 + fprintf(fbsh," pkg_needrebuild=(");
2093 2099 while (currrebuild) {
2094 2100 fprintf(fbsh, "%s ", currrebuild->sourceheader->name);
2095 2101 currrebuild = currrebuild->next;
2096 2102 }
2097   - fprintf(fb,"); }\n\n");
  2103 + fprintf(fbsh,"); }\n");
  2104 + fprintf(fb,"\n");
2098 2105  
2099 2106 }
2100 2107 currheadersourcelist = currheadersourcelist->next;