* parse susetags
*
* fp: file to read from
- * product: solvable representing the product (0 if none)
+ * defvendor: default vendor (0 if none)
* language: current language (0 if none)
* flags: flags
*/
void
-repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int flags)
+repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int flags)
{
Pool *pool = repo->pool;
char *line, *linep;
struct parsedata pd;
Repodata *data = 0;
Id handle = 0;
- Id vendor = 0;
if ((flags & SUSETAGS_EXTEND) && repo->nrepodata)
indesc = 1;
else
data = repo_last_repodata(repo);
- if (product)
- {
- if (!strncmp(id2str(pool, pool->solvables[product].name), "product:", 8))
- vendor = pool->solvables[product].vendor;
- }
-
memset(&pd, 0, sizeof(pd));
line = malloc(1024);
aline = 1024;
s->arch = arch;
else
s->arch = str2id(pool, sp[3], 1);
- s->vendor = vendor; /* default to product vendor */
+ s->vendor = defvendor;
}
}
const char *descrdir = 0;
const char *basefile = 0;
const char *query = 0;
- Id product = 0;
+ Id defvendor = 0;
int flags = 0;
int c;
exit(1);
}
repo_add_content(repo, fp, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
- product = repo->start;
- fclose (fp);
+ if (repo->start < repo->end)
+ if (!strncmp(id2str(pool, pool->solvables[repo->start].name), "product:", 8))
+ defvendor = pool->solvables[repo->start].vendor;
+ fclose(fp);
}
if (attrname)
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
else if (!strcmp(fn, "packages.DU") || !strcmp(fn, "packages.DU.gz"))
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
else if (!strcmp(fn, "packages.FL") || !strcmp(fn, "packages.FL.gz"))
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, 0, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, 0, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
#else
/* ignore for now. reactivate when filters work */
perror(fn);
exit(1);
}
- repo_add_susetags(repo, fp, product, lang, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, fp, defvendor, lang, flags | SUSETAGS_EXTEND | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
}
}
else
/* read data from stdin */
- repo_add_susetags(repo, stdin, product, 0, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ repo_add_susetags(repo, stdin, defvendor, 0, REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
repo_internalize(repo);
if (query)