diff options
author | joerg <joerg@pkgsrc.org> | 2007-08-09 23:18:30 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2007-08-09 23:18:30 +0000 |
commit | 7a51a218c2402be5199e42d7ed3e7068397539ec (patch) | |
tree | 7782693cc7e7672ac62409c95a7db35650ecd3a2 /pkgtools/pkg_install/files/lib/pkgdb.c | |
parent | 710504e20a8c6719fb57732597870bc7b4512f19 (diff) | |
download | pkgsrc-7a51a218c2402be5199e42d7ed3e7068397539ec.tar.gz |
Change interface of is_automatic_installed and
mark_as_automatic_installed to take a package name and not a full path.
Add assertions to test for this.
Drop a few islinktodir checks.
Change pkg_info to use iterate_pkg_db instead of scanning the directory
by hand. As a side effect don't try to check for the pkgdb dir first,
let pkgdb_dump and iterate_pkg_db handle that.
Make pkgdb_dump return failure if it can't open the package db.
Diffstat (limited to 'pkgtools/pkg_install/files/lib/pkgdb.c')
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkgdb.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgtools/pkg_install/files/lib/pkgdb.c b/pkgtools/pkg_install/files/lib/pkgdb.c index 96b959dea62..5a602f6cd7d 100644 --- a/pkgtools/pkg_install/files/lib/pkgdb.c +++ b/pkgtools/pkg_install/files/lib/pkgdb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pkgdb.c,v 1.25 2006/01/04 23:33:23 christos Exp $ */ +/* $NetBSD: pkgdb.c,v 1.26 2007/08/09 23:18:31 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -8,7 +8,7 @@ #include <sys/cdefs.h> #endif #ifndef lint -__RCSID("$NetBSD: pkgdb.c,v 1.25 2006/01/04 23:33:23 christos Exp $"); +__RCSID("$NetBSD: pkgdb.c,v 1.26 2007/08/09 23:18:31 joerg Exp $"); #endif /* @@ -189,7 +189,7 @@ pkgdb_retrieve(const char *key) } /* dump contents of the database to stdout */ -void +int pkgdb_dump(void) { DBT key; @@ -203,8 +203,9 @@ pkgdb_dump(void) (int) val.size, (char *) val.data); } pkgdb_close(); - } - + return 0; + } else + return -1; } /* @@ -278,7 +279,7 @@ int pkgdb_open(int mode) { return 1; } void pkgdb_close(void) {} int pkgdb_store(const char *key, const char *val) { return 0; } char *pkgdb_retrieve(const char *key) { return NULL; } -void pkgdb_dump(void) {} +int pkgdb_dump(void) { return 0; } int pkgdb_remove(const char *key) { return 0; } int pkgdb_remove_pkg(const char *pkg) { return 1; } |