| |
const char *comment;
|
| |
const char *desc;
|
| |
const char *{pre|post}-{install|deinstall|upgrade};
|
| + |
size_t dep, file; /* iterator for deps and files */
|
| |
pkg_t type;
|
| - |
/* errors ? */
|
| + |
/* errors, options */
|
| |
/* Draft, extra info for each possible pkg_t */
|
| |
size_t idx; /* index on cache if PKG_CACHE */
|
| - |
const char *path; /* PKG_PACKAGE, PKG_PORT */
|
| - |
const char *url; /* PKG_REMOTE */
|
| |
struct pkg_manifest *manifest; /* manifest reference, plist+options, package directory etc */
|
| |
};
|
| |
|
| |
api usage :
|
| |
|
| |
int pkgdb_query(struct pkgdb *, struct pkg *pkg, match_t, const char *pattern);
|
| - |
A query using pkgdb_query return each time a result into "pkg" and stop with a spécific return code (< 0)
|
| + |
- attach cdb db to pkg.
|
| + |
- A query using pkgdb_query return each time a result into "pkg" and stop with a spécific return code (< 0)
|
| |
|
| |
for each field (namever, name, version, origin...) there is an accessor
|
| |
Example:
|
| - |
pkg_name(struct pkgdb *, struct pkg *)
|
| - |
pkg_dep(struct pkgdb *db, struct pkg *pkg, struct pkg *dep)
|
| - |
...
|
| + |
pkg_name(struct pkg *)
|
| + |
pkg_dep(struct pkg *pkg, struct pkg *dep) -> iterate
|
| + |
pkg_file(struct pkg *pkg) -> iterate
|
| |
|
| |
STUPID IDEA: why not function pointer on struct pkgdb for accessing pkgs ?
|
| |
pkgdb_query can set info on query type (remote, package, local, port) and init pointers on several function.
|
| |
|
| |
while ((query = pkgdb_query(&db, &pkg, MATCH_NONE, NULL)) > 0) {
|
| |
printf("%s depend on:\n", pkg_namever(&pkg));
|
| - |
while (pkg_deps(&db, &pkg, &dep) > 0)
|
| + |
while (pkg_deps(&pkg, &dep) > 0)
|
| |
printf("%s\n", pkg_namever(&dep));
|
| |
printf("\n\n");
|
| |
}
|