diff --git a/src/distromatic.c b/src/distromatic.c index ebef2aa..4fba577 100644 --- a/src/distromatic.c +++ b/src/distromatic.c @@ -464,7 +464,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) if ((currheader->require[i]->name)[0] == '/') { /* requirement is a file, find who provides it */ - file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name); + file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name, archidx); if (file->numproviders > 0) { scanheader=file->provider[0]; provided->numproviders=file->numproviders; @@ -550,7 +550,7 @@ resolveFirstLevelDependencies(struct configTag *ct, int archidx) } if ((currheader->require[i]->name)[0] == '/') { /* when there is a Requires: /file/requirement add provide from file tree as well */ - file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name); + file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currheader->require[i]->name, archidx); for (k = 0; k < file->numproviders; k++) { for (j = 0, found = 0; j < provided->numproviders; j++) { /* avoid duplicates */ @@ -717,7 +717,7 @@ resolveFirstLevelSourceDependencies(struct configTag *ct, int archidx) if ((currsourceheader->require[i]->name)[0] == '/') { /* requirement is a file, find who provides it */ - file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currsourceheader->require[i]->name); + file=findOrCreateFileTreeEntry(&ct->filetree[archidx],currsourceheader->require[i]->name, archidx); if (file->numproviders > 0) { provided->numbuildproviders=file->numproviders; provided->buildprovider=file->provider; diff --git a/src/headerlist.c b/src/headerlist.c index d8c9bd5..fc22c70 100644 --- a/src/headerlist.c +++ b/src/headerlist.c @@ -465,9 +465,9 @@ findOrCreateProvidedListEntry(struct providedList* *idx, } struct fileTree* -findOrCreateFileTreeBrother(struct fileTree* *first,char* findname) +findOrCreateFileTreeBrother(struct fileTree* *first,char* findname, int arch) { - static long id = 0; + static long id[ARCHS_MAX] = { 0, 0, 0, 0, 0}; struct fileTree *newdir, *currdir, *prevdir = NULL; int c = 0; @@ -486,7 +486,7 @@ findOrCreateFileTreeBrother(struct fileTree* *first,char* findname) newdir->provider = NULL; newdir->numproviders = 0; newdir->parent = NULL; - newdir->id = id++; + newdir->id = id[arch]++; if (prevdir) { newdir->next = prevdir->next; @@ -503,7 +503,7 @@ findOrCreateFileTreeBrother(struct fileTree* *first,char* findname) } struct fileTree* -findOrCreateFileTreeEntry(struct fileTree* *first,char* findname) +findOrCreateFileTreeEntry(struct fileTree* *first,char* findname, int arch) { struct fileTree *currdir,*prevdir=NULL; char *pstart,*pend; @@ -523,11 +523,11 @@ findOrCreateFileTreeEntry(struct fileTree* *first,char* findname) f[pend-pstart]='\0'; if (prevdir) { - currdir = findOrCreateFileTreeBrother(&prevdir->firstchild,f); + currdir = findOrCreateFileTreeBrother(&prevdir->firstchild,f,arch); currdir->parent = prevdir; } else - currdir = findOrCreateFileTreeBrother(first,f); + currdir = findOrCreateFileTreeBrother(first,f,arch); if (!*first) *first = currdir; @@ -1054,7 +1054,7 @@ addToHeaderList(struct configTag *ct, malloc(sizeof(struct fileTree*) * filenamecount); for (j=0; jfile[j] = findOrCreateFileTreeEntry(&ct->filetree[arch],filename); + newheaderlist->file[j] = findOrCreateFileTreeEntry(&ct->filetree[arch],filename,arch); if (newheaderlist->file[j]->numproviders == 0) { newheaderlist->file[j]->numproviders++; newheaderlist->file[j]->provider=malloc(sizeof(struct headerList*)); diff --git a/src/include/headerlist.h b/src/include/headerlist.h index d4adf46..ad2c534 100644 --- a/src/include/headerlist.h +++ b/src/include/headerlist.h @@ -168,10 +168,10 @@ findOrCreateProvidedListEntry(struct providedList **idx, char* findname, int create, int arch); struct fileTree* -findOrCreateFileTreeBrother(struct fileTree* *first,char* findname); +findOrCreateFileTreeBrother(struct fileTree* *first,char* findname, int arch); struct fileTree* -findOrCreateFileTreeEntry(struct fileTree* *first,char* findname); +findOrCreateFileTreeEntry(struct fileTree* *first,char* findname, int arch); void cleanProvidedListIndex(struct configTag *ct, int arch);