From 01c345c57946acd88415bb954731e199785f6e45 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 12 Aug 2011 17:31:13 +0200 Subject: [PATCH] Add obsoleted flag in headerList struct and set it to fix (remove) obsoleted packages handling in deps-* lists --- src/distromatic.c | 1 + src/headerlist.c | 3 +-- src/include/headerlist.h | 1 + src/reports.c | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/distromatic.c b/src/distromatic.c index 8fa1a69..4a1053c 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -279,6 +279,7 @@ handleObsoletedPackages(struct configTag *ct, int archidx) for (i = 0; i < prov->numproviders; i++) { if (obs[i] >=0) { j--; + prov->provider[i]->obsoleted=1; prov->provider[i]=NULL; } } diff --git a/src/headerlist.c b/src/headerlist.c index 3bac70c..5dca3c9 100644 --- a/src/headerlist.c +++ b/src/headerlist.c @@ -883,8 +883,7 @@ addToHeaderList(struct configTag *ct, logmsg(LOG_ERROR,"header in file %s is corrupted; aborting.\n",filepath); return 1; } - newheaderlist->next = NULL; - newheaderlist->nextbrother = NULL; + memset(newheaderlist, 0, sizeof(struct headerList)); getPackageInfoIntoHeaderList(h, newheaderlist); if (!newheaderlist->sourcename) { diff --git a/src/include/headerlist.h b/src/include/headerlist.h index 539771f..16d794c 100644 --- a/src/include/headerlist.h +++ b/src/include/headerlist.h @@ -84,6 +84,7 @@ struct headerList { struct requireList *requirelist; struct headerList *next, *nextbrother; struct headerSourceList *sourceheader; + int obsoleted; }; struct headerSourceList { diff --git a/src/reports.c b/src/reports.c index b598bc8..afc60fc 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1828,9 +1828,12 @@ print_datatables(struct configTag *ct, int arch) { fprintf(fb,"ALL_BUILDS="); currheaderlist = ct->headerlist[arch]; while (currheaderlist) { - fprintf(fd,"%s ", currheaderlist->name); + if (currheaderlist->obsoleted) printf("%s obsoleted\n", currheaderlist->name); fprintf(fs,"%s: _%s\n", currheaderlist->name, currheaderlist->sourceheader->name); - fprintf(fb,"%s ",currheaderlist->name); + if (!currheaderlist->obsoleted) { + fprintf(fd,"%s ", currheaderlist->name); + fprintf(fb,"%s ",currheaderlist->name); + } currheaderlist = currheaderlist->next; } fprintf(fd,"\n");