};
static void usage() {
- printf("usage: ...\n");
+ printf("usage: zpm foreach-path [-fncC] args ...\n");
}
static int run_program(void *f, int ncols, char **vals, char **cols) {
char *s;
int opt;
- struct config conf = { "/var/lib/db.zpm", 0, 0, 0, "", 0, 0, printpaths
+ struct config conf = { "/var/lib/zpm/local.db", 0, 0, 0, "", 0, 0, printpaths
};
-
if ((s = getenv("ZPMDB"))) {
/* TODO does this need to be copied ? */
conf.dbfile = s;
argn++;
} else {
fprintf(stderr, "must specify pkgid\n");
+ usage();
exit(EXIT_FAILURE);
}
/* install a collation function */
// zpm_addvercmp(&pkg);
- if (!zpm_foreach_path(&pkg, conf.pkgid, conf.callback, &conf, &errmsg)) {
+ if (!zpm_foreach_path(&pkg, conf.pkgid, 0, conf.callback, &conf, &errmsg)) {
if (errmsg) {
fprintf(stderr, "database error: %s\n", errmsg);
exit(EXIT_FAILURE);