for (const struct __relation* relation = relations; relation->type; relation++) {
char* relations = pakfire_archive_get(archive, "dependencies", relation->type);
if (relations)
- pakfire_parse_deps(archive->pakfire, pkg, relation->func, relations);
+ pakfire_str2deps(archive->pakfire, pkg, relation->func, relations);
}
// Import filelist
for (const struct dependency* deps = dependencies; deps->field; deps++) {
const char* relations = (const char*)sqlite3_column_text(stmt, deps->field);
if (relations) {
- pakfire_parse_deps(db->pakfire, pkg, deps->func, relations);
+ pakfire_str2deps(db->pakfire, pkg, deps->func, relations);
}
}
#include <pakfire/package.h>
const char* pakfire_dep2str(struct pakfire* pakfire, Id id);
-Id pakfire_parse_dep(struct pakfire* pakfire, const char* s);
-void pakfire_parse_deps(struct pakfire* pakfire, struct pakfire_package* pkg,
+Id pakfire_str2dep(struct pakfire* pakfire, const char* s);
+void pakfire_str2deps(struct pakfire* pakfire, struct pakfire_package* pkg,
void (*func)(struct pakfire_package* pkg, const char* dep), const char* deps);
#define pakfire_string_format(s, fmt, ...) snprintf(s, sizeof(s) - 1, fmt, __VA_ARGS__)
Solvable* s = get_solvable(pkg);
// Parse the dependency
- Id id = pakfire_parse_dep(pkg->pakfire, dep);
+ Id id = pakfire_str2dep(pkg->pakfire, dep);
if (!id)
return;
pakfire_pool_apply_changes(pakfire);
// Translate dependency to ID
- Id dep = pakfire_parse_dep(pakfire, what);
+ Id dep = pakfire_str2dep(pakfire, what);
if (!dep) {
errno = EINVAL;
return 1;
if (is_source) {
char* requires = pakfire_parser_get(parser, "build", "requires");
if (requires) {
- pakfire_parse_deps(parser->pakfire, *pkg,
+ pakfire_str2deps(parser->pakfire, *pkg,
pakfire_package_add_requires, requires);
free(requires);
}
for (const struct relation* relation = relations; relation->type; relation++) {
char* relations = pakfire_parser_get(parser, namespace, relation->type);
if (relations) {
- pakfire_parse_deps(parser->pakfire, *pkg, relation->func, relations);
+ pakfire_str2deps(parser->pakfire, *pkg, relation->func, relations);
free(relations);
}
}
// Did we find anything?
if (jobs.count == 0) {
- Id id = pakfire_parse_dep(request->pakfire, what);
+ Id id = pakfire_str2dep(request->pakfire, what);
if (!id)
return 1;
return pool_rel2id(pool, namespace, id, REL_NAMESPACE, 1);
}
-Id pakfire_parse_dep(struct pakfire* pakfire, const char* s) {
+Id pakfire_str2dep(struct pakfire* pakfire, const char* s) {
Id id;
if (!s) {
return id;
}
-void pakfire_parse_deps(struct pakfire* pakfire, struct pakfire_package* pkg,
+void pakfire_str2deps(struct pakfire* pakfire, struct pakfire_package* pkg,
void (*func)(struct pakfire_package* pkg, const char* dep), const char* deps) {
char* p = strdupa(deps);